@realsee/five 5.0.0-alpha.21 → 5.0.0-alpha.210

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 (256) hide show
  1. package/README.md +18 -8
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/highlight.css +134 -0
  4. package/docs/assets/icons.css +1043 -0
  5. package/docs/assets/main.js +52 -0
  6. package/docs/assets/search.js +1 -0
  7. package/docs/assets/style.css +1414 -0
  8. package/docs/classes/five.AnimationFrameLoop.html +15 -0
  9. package/docs/classes/five.BVH.html +10 -0
  10. package/docs/classes/five.BVHIntersect.html +1 -0
  11. package/docs/classes/five.BVHNode.html +7 -0
  12. package/docs/classes/five.BVHVector3.html +1 -0
  13. package/docs/classes/five.Camera.html +11 -0
  14. package/docs/classes/five.Clipper.html +1 -0
  15. package/docs/classes/five.Five.html +335 -0
  16. package/docs/classes/five.InternalWebGLRenderer.html +1 -0
  17. package/docs/classes/five.IntersectMesh.html +1 -0
  18. package/docs/classes/five.Model.html +99 -0
  19. package/docs/classes/five.NetworkSubscribe.html +50 -0
  20. package/docs/classes/five.PBMContainer.html +17 -0
  21. package/docs/classes/five.PBMGroup.html +19 -0
  22. package/docs/classes/five.PBMMaterial.html +29 -0
  23. package/docs/classes/five.PBMMesh.html +7 -0
  24. package/docs/classes/five.PanoCircleMesh.html +7 -0
  25. package/docs/classes/five.PanoCircleMeshCustom.html +7 -0
  26. package/docs/classes/five.PanoCircleMeshSolid.html +7 -0
  27. package/docs/classes/five.Scene.html +3 -0
  28. package/docs/classes/five.Subscribe.html +56 -0
  29. package/docs/classes/five.TextureLoader.html +1 -0
  30. package/docs/classes/five.Tile3D.html +34 -0
  31. package/docs/classes/five.Tile3DModel.html +15 -0
  32. package/docs/classes/five.TileBoundingSphere.html +1 -0
  33. package/docs/classes/five.TileCacheNode.html +1 -0
  34. package/docs/classes/five.TileCubeTextureTarget.html +1 -0
  35. package/docs/classes/five.TileCullingVolume.html +1 -0
  36. package/docs/classes/five.TileOrientedBoundingBox.html +1 -0
  37. package/docs/classes/five.TileRequestScheduler.html +16 -0
  38. package/docs/classes/five.Tileset3D.html +11 -0
  39. package/docs/classes/five.Tileset3DTraverser.html +1 -0
  40. package/docs/classes/five.TilesetCache.html +1 -0
  41. package/docs/classes/five.Work.html +32 -0
  42. package/docs/classes/five.XRButton.html +1 -0
  43. package/docs/classes/gltf_loader.DDSLoader.html +1 -0
  44. package/docs/classes/gltf_loader.DRACOLoader.html +1 -0
  45. package/docs/classes/gltf_loader.GLTFLoader.html +17 -0
  46. package/docs/classes/gltf_loader.GLTFObject.html +7 -0
  47. package/docs/classes/gltf_loader.GLTFParser.html +1 -0
  48. package/docs/classes/gltf_loader.THREEGLTFLoader.html +1 -0
  49. package/docs/classes/line.Line.html +1 -0
  50. package/docs/classes/line.LineGeometry.html +1 -0
  51. package/docs/classes/line.LineMaterial.html +1 -0
  52. package/docs/classes/line.LineSegmentsGeometry.html +1 -0
  53. package/docs/classes/line.THREE_Line2.html +1 -0
  54. package/docs/classes/line.THREE_LineSegments2.html +1 -0
  55. package/docs/classes/react.Store.html +29 -0
  56. package/docs/classes/server.BVH.html +10 -0
  57. package/docs/classes/server.BVHIntersect.html +1 -0
  58. package/docs/classes/server.BVHNode.html +7 -0
  59. package/docs/classes/server.BVHVector3.html +1 -0
  60. package/docs/classes/server.Model.html +70 -0
  61. package/docs/classes/server.PBMContainer.html +7 -0
  62. package/docs/classes/server.PBMGroup.html +9 -0
  63. package/docs/classes/server.PBMMesh.html +7 -0
  64. package/docs/classes/sticker.Sticker.html +32 -0
  65. package/docs/classes/vfx.Airflow.html +1 -0
  66. package/docs/classes/vfx.Flame.html +1 -0
  67. package/docs/classes/vfx.Particle.html +89 -0
  68. package/docs/classes/vfx.SpotLight.html +1 -0
  69. package/docs/index.html +166 -434
  70. package/docs/interfaces/five.AddableObject.html +9 -0
  71. package/docs/interfaces/five.AnimationFrame.html +1 -0
  72. package/docs/interfaces/five.CameraPose.html +1 -0
  73. package/docs/interfaces/five.ClipperParameter.html +1 -0
  74. package/docs/interfaces/five.DepthPanoramaControllerCustomInitArgs.html +28 -0
  75. package/docs/interfaces/five.EventCallback.html +405 -0
  76. package/docs/interfaces/five.FiveInitArgs.html +111 -0
  77. package/docs/interfaces/five.FloorplanControllerCustomInitArgs.html +17 -0
  78. package/docs/interfaces/five.ImageOptions.html +18 -0
  79. package/docs/interfaces/five.ImageURLMappings.html +1 -0
  80. package/docs/interfaces/five.ImageURLOptions.html +15 -0
  81. package/docs/interfaces/five.IntersectMeshInterface.html +3 -0
  82. package/docs/interfaces/five.Intersection.html +7 -0
  83. package/docs/interfaces/five.MapviewControllerCustomInitArgs.html +15 -0
  84. package/docs/interfaces/five.ModelControllerCustomInitArgs.html +20 -0
  85. package/docs/interfaces/five.ModelEventCallback.html +26 -0
  86. package/docs/interfaces/five.ModelLodOptions.html +1 -0
  87. package/docs/interfaces/five.MotionKeyframe.html +1 -0
  88. package/docs/interfaces/five.MovePanoOptions.html +42 -0
  89. package/docs/interfaces/five.NetworkOptions.html +9 -0
  90. package/docs/interfaces/five.PBMPanoPicture.html +7 -0
  91. package/docs/interfaces/five.PBMParameters.html +29 -0
  92. package/docs/interfaces/five.PanoCircleMeshCustomOptions.html +1 -0
  93. package/docs/interfaces/five.PanoCircleMeshInterface.html +19 -0
  94. package/docs/interfaces/five.PanoCircleMeshOptions.html +1 -0
  95. package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +1 -0
  96. package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +35 -0
  97. package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +20 -0
  98. package/docs/interfaces/five.Pose.html +37 -0
  99. package/docs/interfaces/five.Scissor.html +14 -0
  100. package/docs/interfaces/five.State.html +21 -0
  101. package/docs/interfaces/five.SubscribeMixinType.emit.html +1 -0
  102. package/docs/interfaces/five.SubscribeMixinType.hasListener.html +1 -0
  103. package/docs/interfaces/five.SubscribeMixinType.off.html +1 -0
  104. package/docs/interfaces/five.SubscribeMixinType.on.html +1 -0
  105. package/docs/interfaces/five.SubscribeMixinType.once.html +1 -0
  106. package/docs/interfaces/five.TextureOptions.html +20 -0
  107. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +3 -0
  108. package/docs/interfaces/five.TileBoundingVolume.html +19 -0
  109. package/docs/interfaces/five.TileContent.html +1 -0
  110. package/docs/interfaces/five.TileCubeNode.html +1 -0
  111. package/docs/interfaces/five.TileCubeTree.html +1 -0
  112. package/docs/interfaces/five.Tileset3dOptions.html +1 -0
  113. package/docs/interfaces/five.TilesetJSON.html +1 -0
  114. package/docs/interfaces/five.TilesetJSONNode.html +1 -0
  115. package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +9 -0
  116. package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +31 -0
  117. package/docs/interfaces/five.WebXRAxesParams.html +1 -0
  118. package/docs/interfaces/five.WebXRControllerParams.html +1 -0
  119. package/docs/interfaces/five.WorkCubeImage.html +13 -0
  120. package/docs/interfaces/five.WorkImage.html +21 -0
  121. package/docs/interfaces/five.WorkInitial.html +13 -0
  122. package/docs/interfaces/five.WorkModel.html +11 -0
  123. package/docs/interfaces/five.WorkModelTiles.html +3 -0
  124. package/docs/interfaces/five.WorkObserver.html +27 -0
  125. package/docs/interfaces/five.WorkTile.html +1 -0
  126. package/docs/interfaces/five.WorkVideo.html +9 -0
  127. package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +31 -0
  128. package/docs/interfaces/gltf_loader.DDS.html +1 -0
  129. package/docs/interfaces/gltf_loader.GLTF.html +7 -0
  130. package/docs/interfaces/gltf_loader.GLTFReference.html +1 -0
  131. package/docs/interfaces/gltf_loader.THREEGLTF.html +1 -0
  132. package/docs/interfaces/react.FiveActionReactCallbacks.html +52 -0
  133. package/docs/interfaces/react.FiveInjectionTypes.html +181 -0
  134. package/docs/interfaces/react.PropTypeOfFiveFeatures.html +1 -0
  135. package/docs/interfaces/server.Intersection.html +7 -0
  136. package/docs/interfaces/server.ModelEventCallback.html +18 -0
  137. package/docs/interfaces/sticker.IntersectionLike.html +8 -0
  138. package/docs/interfaces/vfx.ParticleArgs.html +75 -0
  139. package/docs/interfaces/vfx.ParticleTweenKeyframe.html +1 -0
  140. package/docs/interfaces/vue.FiveActionVueCallbacks.html +60 -0
  141. package/docs/modules/five.SubscribeMixinType.html +1 -0
  142. package/docs/modules/five.html +470 -3006
  143. package/docs/modules/gltf_loader.html +1 -155
  144. package/docs/modules/line.html +1 -210
  145. package/docs/modules/react.html +130 -1507
  146. package/docs/modules/server.html +18 -526
  147. package/docs/modules/sticker.html +1 -151
  148. package/docs/modules/vfx.html +1 -0
  149. package/docs/modules/vue.html +115 -0
  150. package/docs/modules.html +1 -136
  151. package/exporters/staticify.js +210 -0
  152. package/five/index.d.ts +1505 -283
  153. package/five/index.js +362 -1
  154. package/gltf-loader/index.d.ts +90 -5
  155. package/gltf-loader/index.js +260 -1
  156. package/line/index.d.ts +1 -0
  157. package/line/index.js +260 -1
  158. package/package.json +12 -11
  159. package/react/index.d.ts +73 -72
  160. package/react/index.js +260 -1
  161. package/scripts/five-staticify.js +26 -0
  162. package/server/index.d.ts +222 -27
  163. package/server/index.js +357 -1
  164. package/sticker/index.d.ts +2 -1
  165. package/sticker/index.js +260 -1
  166. package/templates/quick-start/package.json +1 -1
  167. package/umd/five-gltf-loader.js +1 -2
  168. package/umd/five-line.js +1 -2
  169. package/umd/five-react.js +1 -2
  170. package/umd/five-sticker.js +1 -2
  171. package/umd/five-vfx.js +1 -0
  172. package/umd/five-vue.js +1 -0
  173. package/umd/five.js +1 -1
  174. package/umd/five.js.LICENSE.txt +58 -118
  175. package/vfx/index.d.ts +264 -0
  176. package/vfx/index.js +260 -0
  177. package/vue/index.d.ts +441 -0
  178. package/vue/index.js +260 -0
  179. package/docs/assets/css/main.css +0 -2660
  180. package/docs/assets/js/main.js +0 -248
  181. package/docs/assets/js/search.js +0 -1
  182. package/docs/classes/five.camera.html +0 -323
  183. package/docs/classes/five.five-1.html +0 -2670
  184. package/docs/classes/five.hashcubetexture.html +0 -252
  185. package/docs/classes/five.internalwebglrenderer.html +0 -212
  186. package/docs/classes/five.model.html +0 -962
  187. package/docs/classes/five.pbmcontainer.html +0 -411
  188. package/docs/classes/five.pbmgroup.html +0 -430
  189. package/docs/classes/five.pbmmaterial.html +0 -533
  190. package/docs/classes/five.pbmmesh.html +0 -254
  191. package/docs/classes/five.scene.html +0 -263
  192. package/docs/classes/five.subscribe.html +0 -569
  193. package/docs/classes/gltf_loader.gltfloader.html +0 -412
  194. package/docs/classes/gltf_loader.gltfobject.html +0 -287
  195. package/docs/classes/line.line-1.html +0 -384
  196. package/docs/classes/line.linegeometry.html +0 -530
  197. package/docs/classes/line.linematerial.html +0 -306
  198. package/docs/classes/line.linesegmentsgeometry.html +0 -477
  199. package/docs/classes/line.three_line2.html +0 -280
  200. package/docs/classes/line.three_linesegments2.html +0 -282
  201. package/docs/classes/react.store.html +0 -605
  202. package/docs/classes/server.model.html +0 -823
  203. package/docs/classes/server.pbmgroup.html +0 -366
  204. package/docs/classes/server.pbmmesh.html +0 -335
  205. package/docs/classes/sticker.sticker-1.html +0 -465
  206. package/docs/interfaces/five.addableobject.html +0 -234
  207. package/docs/interfaces/five.depthpanoramacontrollercustominitargs.html +0 -420
  208. package/docs/interfaces/five.eventcallback.html +0 -2548
  209. package/docs/interfaces/five.fiveinitargs.html +0 -707
  210. package/docs/interfaces/five.floorplancontrollercustominitargs.html +0 -295
  211. package/docs/interfaces/five.imageoptions.html +0 -332
  212. package/docs/interfaces/five.intersection.html +0 -227
  213. package/docs/interfaces/five.intersectmeshinterface.html +0 -188
  214. package/docs/interfaces/five.modelcontrollercustominitargs.html +0 -366
  215. package/docs/interfaces/five.modeleventcallback.html +0 -367
  216. package/docs/interfaces/five.movepanooptions.html +0 -469
  217. package/docs/interfaces/five.panocirclemeshinterface.html +0 -361
  218. package/docs/interfaces/five.panoramacontrollercustominitargs.html +0 -464
  219. package/docs/interfaces/five.panoramalikecontrollercustominitargs.html +0 -364
  220. package/docs/interfaces/five.pbmparameters.html +0 -474
  221. package/docs/interfaces/five.pose.html +0 -270
  222. package/docs/interfaces/five.scissor.html +0 -252
  223. package/docs/interfaces/five.state.html +0 -300
  224. package/docs/interfaces/five.subscribemixintype.emit.html +0 -180
  225. package/docs/interfaces/five.subscribemixintype.haslistener.html +0 -171
  226. package/docs/interfaces/five.subscribemixintype.off.html +0 -198
  227. package/docs/interfaces/five.subscribemixintype.on.html +0 -213
  228. package/docs/interfaces/five.subscribemixintype.once.html +0 -210
  229. package/docs/interfaces/five.topviewcontrollercustominitargs.html +0 -226
  230. package/docs/interfaces/five.vrpanoramacontrollercustominitargs.html +0 -452
  231. package/docs/interfaces/gltf_loader.gltf.html +0 -304
  232. package/docs/interfaces/react.fiveactionreactcallbacks.html +0 -580
  233. package/docs/interfaces/react.fiveinjectiontypes.html +0 -1625
  234. package/docs/interfaces/react.injectfivetoprops.html +0 -280
  235. package/docs/interfaces/server.intersection.html +0 -308
  236. package/docs/interfaces/server.modeleventcallback.html +0 -409
  237. package/docs/interfaces/sticker.intersectionlike.html +0 -223
  238. package/docs/modules/five.subscribemixintype.html +0 -143
  239. package/scripts/export-five-resource/chfs.exe +0 -0
  240. package/scripts/export-five-resource/fileify.js +0 -192
  241. package/scripts/export-five-resource/format-work.js +0 -71
  242. package/scripts/export-five-resource/staticify.js +0 -327
  243. package/scripts/transcode-model/BufferGeometryUtils.js +0 -832
  244. package/scripts/transcode-model/LoaderSupport.js +0 -1545
  245. package/scripts/transcode-model/MTLLoader.js +0 -602
  246. package/scripts/transcode-model/OBJLoader2.js +0 -1470
  247. package/scripts/transcode-model/obj2pbm.js +0 -65
  248. /package/docs/assets/{images/icons.png → icons.png} +0 -0
  249. /package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  250. /package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  251. /package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  252. /package/resource/{basis_transcoder.js → basis/basis_transcoder.js} +0 -0
  253. /package/resource/{basis_transcoder.wasm → basis/basis_transcoder.wasm} +0 -0
  254. /package/resource/{draco_decoder.js → gltf/draco_decoder.js} +0 -0
  255. /package/resource/{draco_decoder.wasm → gltf/draco_decoder.wasm} +0 -0
  256. /package/resource/{draco_wasm_wrapper.js → gltf/draco_wasm_wrapper.js} +0 -0
package/five/index.js CHANGED
@@ -1 +1,362 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("tslib"),n=require("protobufjs"),i=require("@tweenjs/tween.js"),r=require("json-hash"),o=require("webvr-polyfill"),s=require("hammerjs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function M(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=M(e),c=M(n),l=a(i),d=M(r),N=a(o),p=a(s),h=Number(u.REVISION);if(h<115||h>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');var D=2*Math.PI;function g(e){return(e%D+D)%D}var y=function(e){function n(t){var n=e.call(this,t,1,.1,1e3)||this;return n.pose={longitude:0,latitude:0,fov:t,offset:new u.Vector3},n.computePose(),n}return t.__extends(n,e),n.prototype.computePose=function(){var e=this.getWorldDirection(new u.Vector3);this.pose.longitude=g(-Math.atan2(e.x,-e.z)),this.pose.latitude=-Math.asin(e.y/1),this.pose.fov=this.fov,this.pose.offset.copy(this.position)},n.prototype.setFromPose=function(e){var t,n,i,r,o=g(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),s=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,null!==(n=e.latitude)&&void 0!==n?n:this.pose.latitude)),a=null!==(i=e.fov)&&void 0!==i?i:this.pose.fov,M=null!==(r=e.offset)&&void 0!==r?r:this.pose.offset;this.position.copy(M);var c=Math.abs(Math.cos(s)),l=new u.Vector3(-Math.sin(o)*c,-Math.sin(s),-Math.cos(o)*c);this.lookAt(M.clone().add(l)),this.fov!==a&&(this.fov=a,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=o,this.pose.latitude=s,this.pose.fov=a,this.pose.offset.copy(M)},n.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,offset:this.pose.offset.clone()}},n}(u.PerspectiveCamera),T=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(n,e),n.prototype.add=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.add.apply(this,t)},n.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.remove.apply(this,t)},n}(u.Scene),z=function(e){function n(t){var n=t.preserveDrawingBuffer,i=void 0===n||n,r=t.backgroundColor,o=void 0===r?1579548:r,s=t.backgroundAlpha,a=void 0===s?1:s,M=t.pixelRatio,c=void 0===M?1:M,l=t.antialias,d=void 0!==l&&l,N=e.call(this,{antialias:d,preserveDrawingBuffer:i,alpha:a<1})||this;return N.setPixelRatio(c),N.setClearColor(o,a),N.outputEncoding=u.sRGBEncoding,N.autoClear=!0,N}return t.__extends(n,e),n}(u.WebGLRenderer);function j(e){return null==e}function f(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function v(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function m(){return(v()+v()+"-"+v()+"-4"+v().substr(0,3)+"-"+v()+"-"+v()+v()+v()).toLowerCase()}var w="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),I="undefined"!=typeof performance?function(){return w+performance.now()}:function(){return Date.now()},x=window,L=x.requestAnimationFrame||x.mozRequestAnimationFrame||x.webkitRequestAnimationFrame||x.msRequestAnimationFrame||function(e){return setTimeout(e,16)};function O(e,t){void 0===e&&(e=f),void 0===t&&(t=0),L(t<=0?e:function(){return O(e,t-1)})}function A(e,n){void 0===e&&(e=f);for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var o=!1,s=function(r){e.call.apply(e,t.__spreadArray([n,r],i)),o||"function"!=typeof s||L(s)};return L(s),function(){s=null,o=!0}}var E=0;function C(e){E&&e(E);var t=I();L((function(){e(E=I()-t)}))}C(f);var k=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t.needsRender=!0,t}return t.__extends(n,e),n}(u.Mesh),U=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t}return t.__extends(n,e),n.prototype.getTransparent=function(){var e;return this.traverse((function(t){void 0===e&&t instanceof k&&t.material.forEach((function(t){void 0===e&&1===t.uniforms.originOpacity.value&&(e=t.transparent)}))})),null!=e&&e},n.prototype.setTransparent=function(e){this.traverse((function(t){t instanceof k&&t.material.forEach((function(t){1===t.uniforms.originOpacity.value&&(t.transparent=e)}))}))},n.prototype.getMaterial=function(){var e=null;return this.traverse((function(t){if(null===e&&t instanceof k){var n=t.material[0];e={pano0Map:n.pano0Map,pano0Matrix:n.pano0Matrix,pano1Map:n.pano1Map,pano1Matrix:n.pano1Matrix,modelAlpha:n.modelAlpha,progress:n.progress,useBlackTransition:n.useBlackTransition,perspToOrtho:n.perspToOrtho,opacity:n.opacity,pano0DepthMap:n.pano0DepthMap,panoVideoMap:n.panoVideoMap,panoVideoSize:n.panoVideoSize,panoVideoMatrix:n.panoVideoMatrix,panoVideoAlpha:n.panoVideoAlpha,panoTileMap:n.panoTileMap,panoTileMappings:n.panoTileMappings}}})),e},n.prototype.setMaterial=function(e){this.traverse((function(t){t instanceof k&&t.material.forEach((function(t){void 0!==e.pano0Map&&(t.pano0Map=e.pano0Map),void 0!==e.pano0Matrix&&(t.pano0Matrix=e.pano0Matrix),void 0!==e.pano1Map&&(t.pano1Map=e.pano1Map),void 0!==e.pano1Matrix&&(t.pano1Matrix=e.pano1Matrix),void 0!==e.modelAlpha&&(t.modelAlpha=e.modelAlpha),void 0!==e.progress&&(t.progress=e.progress),void 0!==e.useBlackTransition&&(t.useBlackTransition=e.useBlackTransition),void 0!==e.perspToOrtho&&(t.perspToOrtho=e.perspToOrtho),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.pano0DepthMap&&(t.pano0DepthMap=e.pano0DepthMap),void 0!==e.panoVideoMap&&(t.panoVideoMap=e.panoVideoMap),void 0!==e.panoVideoSize&&(t.panoVideoSize=e.panoVideoSize),void 0!==e.panoVideoMatrix&&(t.panoVideoMatrix=e.panoVideoMatrix),void 0!==e.panoVideoAlpha&&(t.panoVideoAlpha=e.panoVideoAlpha),void 0!==e.panoTileMap&&(t.panoTileMap=e.panoTileMap),void 0!==e.panoTileMappings&&(t.panoTileMappings=e.panoTileMappings)}))}))},n.prototype.disposeMaterial=function(){this.traverse((function(e){if(e instanceof k){var t=[];e.material.forEach((function(e){var n=e.uniforms;Object.keys(n).map((function(e){if(["pano0Map","pano1Map","pano0DepthMap","panoVideoMap","panoTileMap"].indexOf(e)>=0)n[e].value=null;else{var i=n[e].value;i&&"function"==typeof i.dispose&&-1===t.indexOf(i)&&(n[e].value=null,t.push(i))}})),e.dispose()})),t.forEach((function(e){return e.dispose()}))}}))},n.prototype.disposeGeometry=function(){this.traverse((function(e){e instanceof k&&e.geometry.dispose()}))},n}(u.Group),S=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t}return t.__extends(n,e),n}(U),b=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=113,i=126,r=0,o="";return arguments[r].split(o).map((function(e){return e.charCodeAt(r)>i?e:String.fromCharCode((e.charCodeAt(r)+n)%i)})).join(o)}("n\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{H{vs|z-znA-}n{|=ZnvH{vs|z-znA-}n{|>ZnvH{vs|z-rp@-z|qryPr{rH{vs|z-sy|n-}r}a|\\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l]|vv|{;\t-<-|u|Qvn{pr-69-}r}a|\\u|-6H\f"),Q=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=113,i=126,r=0,o="";return arguments[r].split(o).map((function(e){return e.charCodeAt(r)>i?e:String.fromCharCode((e.charCodeAt(r)+n)%i)})).join(o)}("{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n-r}|rH{vs|z-sy|n-|}npv\bH{vs|z-sy|n-|vtv{\\}npv\bH{vs|z-sy|n-z|qryNy}unH{vs|z-sy|n-}|trH{vs|z-nz}yrPor-}n{|=Zn}H{vs|z-nz}yrPor-}n{|>Zn}H{vs|z-nz}yrPor-}n{|=Qr}uZn}H{vs|z-rp?-}n{|cvqr|`v\trH{vs|z-znA-}n{|cvqr|ZnvH{vs|z-sy|n-}n{|cvqr|Ny}unH{vs|z-nz}yr?Q-}n{|cvqr|Zn}H0vs-qrsv{rq5b`RlaVYR6--{vs|z-nz}yr?Q-}n{|avyrZn}H--{vs|z-rpA-}n{|avyrPyv}Zn}}v{thaVYRlZN]]V[TlYR[TaUjH--{vs|z-rpA-}n{|avyrQnNZn}}v{thaVYRlZN]]V[TlYR[TaUjH0r{qvs0vs-.qrsv{rq5b`RlOYNPXla_N[`VaV\\[6-33-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6--n\bv{t-rp@-pnzrna|crrH0r{qvsn\bv{t-rp@-}n{|=a|crrHn\bv{t-rp@-}n{|>a|crrH0v{pyqr-Ip|zz|{K0v{pyqr-I}npxv{tK0v{pyqr-Ip|y|l}nlsntzr{K0v{pyqr-Il}nlsntzr{K0v{pyqr-I?l}nlsntzr{K0v{pyqr-Izn}l}nlsntzr{K0v{pyqr-Iny}unzn}l}nlsntzr{K0v{pyqr-In|zn}l}nlsntzr{K0v{pyqr-Iyvtuzn}l}nlsntzr{K0v{pyqr-Irzvvrzn}l}nlsntzr{K0v{pyqr-Ir{zn}l}nlsntzr{K0v{pyqr-Itnqvr{zn}l}nlsntzr{K0v{pyqr-Is|tl}nlsntzr{K0v{pyqr-IoqsK0v{pyqr-Iyvtul}nlortv{K0v{pyqr-Iyvtul}u|{tl}nlsntzr{K0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=9-=;=9-=;=9->;=60qrsv{r-]Vl?-C;?E@>EB?rp?-|P||q5rp@-rp|6-\n--sy|n--J-yr{tu5rp|6H--sy|n-urn-J-np|5rp|;\b-<-6H--sy|n-}uv-J-nn{5rp|;9-rp|;\t6H--r{-rp?5=;B-8-}uv-<-]Vl?9-urn-<-]V6H\f|vq-znv{56-\n--rpA-qvssrP|y|-J-rpA5qvssr9-|vtv{\\}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r}|rH--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--0v{pyqr-In|zn}lsntzr{K--<<-减少方向光对模型的影响--rp@-|t|v{tYvtu-J-5rsyrprqYvtu;qvrpQvssr-7-=;?6-8----rsyrprqYvtu;v{qvrpQvssr-8----rsyrprqYvtu;v{qvrp`}rpyn-8----|nyRzvvr_nqvn{prH--<<-修复黑色面片的问题--vs-5|t|v{tYvtu;-K-=;=-\v\v-|t|v{tYvtu;t-K-=;=-\v\v-|t|v{tYvtu;o-K-=;=6-\n----tylSntP|y|-J-rpA5|t|v{tYvtu9-qvssrP|y|;n6H--\f-ryr-\n----tylSntP|y|-J-rpA5OYNPXlP\\Y\\_;\b\t9-qvssrP|y|;n6H--\f--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=Zn}9-}n{|=a|crr6H--0vs-qrsv{rq5b`RlaVYR6----rp?-vyrlp||q-J-|P||q5}n{|=a|crr6H----rpA-vyrlpyv}H----rpA-vyrlqnNH----rp?-vyrlH----sy|n-vyrlny}unH----0}ntzn-{|yyly||}lnH----s|-5v{-v-J-=H-v-I-aVYRlZN]]V[TlYR[TaUH-v886-\n------vyrlpyv}-J-}n{|avyrPyv}Zn}}v{thvjH------vyrlqnN-J-}n{|avyrQnNZn}}v{thvjH------vyrl;-J-5vyrlp||q;-:-vyrlpyv}h=j6-<-vyrlpyv}h?jH------vyrl;\b-J-5vyrlp||q;\b-:-vyrlpyv}h>j6-<-vyrlpyv}h@jH------vyrlny}un-J-5>;=-:-r}5=;B9-no5vyrl;-:-=;B666-7-5>;=-:-r}5=;B9-no5vyrl;\b-:-=;B666H------vyrl;-J-vyrlqnNh=j-8-vyrl;-7-vyrlqnNh?jH------vyrl;\b-J-vyrlqnNh>j-8-vyrl;\b-7-vyrlqnNh@jH------vyrlny}un-J-prvy5vyrlny}un-7-vyrlqnNh?j6H------}n{|=P|y|-J-zv5}n{|=P|y|9-rr?Q5}n{|avyrZn}9-vyrl69-vyrlny}un6H----\f----0}ntzn-{|yyly||}lr{q--0r{qvs--rpA-}n{|>P|y|-J-rrPor5}n{|>Zn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv5}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv5}n{|P|y|9-}n{|>P|y|9-zn5=;=9-oynpx]|tr-:-?;=66H--0ryr----0vs-qrsv{rq5b`Rl]N[\\=lQR]aUlZN]6------rpA-}n{|=Qr}uP|y|-J-rrPor5}n{|=Qr}uZn}9-pnzrna|crr6H------sy|n-qrynQvn{pr=-J-no5{}npx_TONa|Qr}u5}n{|=Qr}uP|y|6-7->=;=-:-yr{tu5}n{|=a|crr66H------sy|n-ynry-J-pynz}5}|tr-7-5>;=-8-qrynQvn{pr=-7-=;FB69-=;=9->;=6H----0ryr------sy|n-ynry-J-}|trH----0r{qvs----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-ynry6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\lZN]6----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|ZnvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|`v\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|Zn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q;\t66-7-5>;=-:-r}5=;B9-no5;-:-=;B666-7-5>;=-:-r}5=;B9-no5;\b-:-=;B666H----sy|n-ny}un-J-pynz}5=;=9->;=9-B;=-7-5>;=-:-pynz}5qvn{pr59-rp?5=;B9-=;B66-<-=;BB-9-=;=9->;=666H----}n{|P|y|-J-zv5}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|Ny}un6H--0r{qvs--tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b6H\f"),Y=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.hash=m(),t}return t.__extends(n,e),n}(u.CubeTexture);function P(){return document.createElementNS("http://www.w3.org/1999/xhtml","img")}var _=P();_.width=_.height=8;var B=new u.Texture(_),R=new Y([_,_,_,_,_,_]);B.dispose=R.dispose=function(){};var V=function(e){return{value:e}},F=Object.assign({modelAlpha:V(0),originOpacity:V(1),progress:V(0),pano0Map:V(null),pano0Matrix:V(new u.Matrix4),pano1Map:V(null),pano1Matrix:V(new u.Matrix4),pano0DepthMap:V(null),panoVideoMap:V(null),panoVideoSize:V(new u.Vector2),panoVideoMatrix:V(new u.Matrix4),panoVideoAlpha:V(0),modelCenter:V(new u.Vector3),perspToOrtho:V(0),panoTileMap:V(null),panoTileClipMappings:V([]),panoTileDrawAtMappings:V([])},{exposure:V(1),emissive:V(new u.Color(0)),emissiveMap:V(null),specular:V(new u.Color(1118481)),specularMap:V(null),normalMap:V(null),bumpMap:V(null),shininess:V(30)},u.UniformsLib.common,u.UniformsLib.lights),q=function(e){function n(t){var n,i,r,o,s,a,M,c,l,d,N,p,h,D,g,y;void 0===t&&(t={});var T=e.call(this,{vertexShader:b,fragmentShader:Q,uniforms:u.UniformsUtils.clone(F),defines:{USE_MAP:!0,USE_UV:!0,USE_TILE:!1,TILE_MAPPING_LENGTH:0,USE_BLACK_TRANSITION:!1,USE_PANO0_DEPTH_MAP:!1,USE_PANO_VIDEO_MAP:!1},lights:!0})||this;return Object.defineProperties(T,{pano0Map:{get:function(){var e=this.uniforms.pano0Map.value;return e===R?null:e},set:function(e){this.uniforms.pano0Map.value=null===e?R:e}},pano0Matrix:{get:function(){return this.uniforms.pano0Matrix.value.clone()},set:function(e){this.uniforms.pano0Matrix.value.copy(e)}},pano1Map:{get:function(){var e=this.uniforms.pano1Map.value;return e===R?null:e},set:function(e){this.uniforms.pano1Map.value=null===e?R:e}},pano1Matrix:{get:function(){return this.uniforms.pano1Matrix.value.clone()},set:function(e){this.uniforms.pano1Matrix.value.copy(e)}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(e){this.uniforms.modelAlpha.value=e}},progress:{get:function(){return this.uniforms.progress.value},set:function(e){this.uniforms.progress.value=e}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(e){this.defines.USE_BLACK_TRANSITION!==e&&(this.defines.USE_BLACK_TRANSITION=e,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},perspToOrtho:{get:function(){return this.uniforms.perspToOrtho.value},set:function(e){this.uniforms.perspToOrtho.value=e}},pano0DepthMap:{get:function(){return this.uniforms.pano0DepthMap.value},set:function(e){this.uniforms.pano0DepthMap.value=e;var t=null!==e;t!==this.defines.USE_PANO0_DEPTH_MAP&&(this.defines.USE_PANO0_DEPTH_MAP=t,this.needsUpdate=!0)}},panoVideoMap:{get:function(){return this.uniforms.panoVideoMap.value},set:function(e){this.uniforms.panoVideoMap.value=e;var t=null!==e;t!==this.defines.USE_PANO_VIDEO_MAP&&(this.defines.USE_PANO_VIDEO_MAP=t,this.needsUpdate=!0)}},panoVideoSize:{get:function(){return this.uniforms.panoVideoSize.value.clone()},set:function(e){this.uniforms.panoVideoSize.value.copy(e)}},panoVideoMatrix:{get:function(){return this.uniforms.panoVideoMatrix.value.clone()},set:function(e){this.uniforms.panoVideoMatrix.value.copy(e)}},panoVideoAlpha:{get:function(){return this.uniforms.panoVideoAlpha.value},set:function(e){this.uniforms.panoVideoAlpha.value=e}},panoTileMap:{get:function(){return this.uniforms.panoTileMap.value},set:function(e){this.uniforms.panoTileMap.value=e;var t=null!==e;t!==this.defines.USE_TILE&&(this.defines.USE_TILE=t,this.needsUpdate=!0)}},panoTileMappings:{get:function(){var e=this.uniforms.panoTileClipMappings.value,t=this.uniforms.panoTileDrawAtMappings.value;if(null===e)return null;for(var n=[],i=0;i<e.length;i++)n[i]=[e[i].clone(),t[i].clone()];return n},set:function(e){var t=this.defines.TILE_MAPPING_LENGTH;if(null===e)this.uniforms.panoTileClipMappings.value=null,this.uniforms.panoTileDrawAtMappings.value=null;else{for(var n=[],i=[],r=0;r<e.length;r++)n[r]=e[r][0].clone(),i[r]=e[r][1].clone();this.uniforms.panoTileClipMappings.value=n,this.uniforms.panoTileDrawAtMappings.value=i}var o=null!==e?e.length:0;o!==t&&(this.defines.TILE_MAPPING_LENGTH=o,this.needsUpdate=!0)}}}),T.pano0Map=null!==(n=t.pano0Map)&&void 0!==n?n:R,T.pano0Matrix=null!==(i=t.pano0Matrix)&&void 0!==i?i:new u.Matrix4,T.pano1Map=null!==(r=t.pano1Map)&&void 0!==r?r:R,T.pano1Matrix=null!==(o=t.pano1Matrix)&&void 0!==o?o:new u.Matrix4,T.modelAlpha=null!==(s=t.modelAlpha)&&void 0!==s?s:1,T.progress=null!==(a=t.progress)&&void 0!==a?a:0,T.useBlackTransition=null!==(M=t.useBlackTransition)&&void 0!==M&&M,T.perspToOrtho=null!==(c=t.perspToOrtho)&&void 0!==c?c:0,T.opacity=null!==(l=t.opacity)&&void 0!==l?l:1,T.pano0DepthMap=null!==(d=t.pano0DepthMap)&&void 0!==d?d:null,T.panoVideoSize=null!==(N=t.panoVideoSize)&&void 0!==N?N:new u.Vector2,T.panoVideoMap=null!==(p=t.panoVideoMap)&&void 0!==p?p:null,T.panoVideoMatrix=null!==(h=t.panoVideoMatrix)&&void 0!==h?h:new u.Matrix4,T.panoVideoAlpha=null!==(D=t.panoVideoAlpha)&&void 0!==D?D:0,T.panoTileMap=null!==(g=t.panoTileMap)&&void 0!==g?g:null,T.panoTileMappings=null!==(y=t.panoTileMappings)&&void 0!==y?y:null,T}return t.__extends(n,e),n}(u.ShaderMaterial),H=new u.Vector3(0,0,0),G=function(e){function n(t,n){void 0===n&&(n=H);var i=e.call(this)||this,r=new u.BoxBufferGeometry(t.max.x-t.min.x+2*n.x,t.max.y-t.min.y+2*n.y,t.max.z-t.min.z+2*n.z,1,1);r.groups.length=0,r.groups.push({start:0,count:36,materialIndex:0}),r.applyMatrix4((new u.Matrix4).makeScale(-1,1,1));var o=new q;o.defines.USE_MAP=!1,o.defines.USE_UV=!1,o.uniforms.diffuse.value=new u.Color(16777215);var s=new k(r,[o]);return s.floorIndex=-1,s.position.copy(t.getCenter(new u.Vector3)),s.frustumCulled=!1,i.add(s),i}return t.__extends(n,e),n.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},n}(S);function W(e,t){return void 0===t&&(t=H),new G(e,t)}var Z,J,X,K,$={};$.EPSILON=1e-6,$.BVHVector3=function(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0},$.BVHVector3.prototype={constructor:$.BVHVector3,copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setFromArray:function(e,t){this.x=e[t],this.y=e[t+1],this.z=e[t+2]},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},cross:function(e){var t=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-t*e.z,this.z=t*e.y-n*e.x,this},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,o=t.x,s=t.y,a=t.z;return this.x=i*a-r*s,this.y=r*o-n*a,this.z=n*s-i*o,this},clone:function(){return new $.BVHVector3(this.x,this.y,this.z)}},$.BVH=function(e,t){this._trianglesArray=e,this._maxTrianglesPerNode=t||10,this._bboxArray=this.calcBoundingBoxes(e),this._bboxHelper=new Float32Array(this._bboxArray.length),this._bboxHelper.set(this._bboxArray);var n=e.length/9,i=this.calcExtents(0,n,$.EPSILON);this._rootNode=new $.BVHNode(i[0],i[1],0,n,0),this._nodesToSplit=[this._rootNode]},$.BVH.prototype.splitNode=function(e){if(e){var t=0,n=function(){t++;var i=this._nodesToSplit.pop();i?(this._splitNode(i),t%255==0?setTimeout(n):n()):(t=0,e())}.bind(this);n()}else for(;this._nodesToSplit.length>0;)this._splitNode(this._nodesToSplit.pop())},$.BVH.prototype.dispose=function(){this._trianglesArray=new Float32Array,this._bboxArray=new Float32Array,this._bboxHelper=new Float32Array,this._rootNode=null,this._nodesToSplit=null},$.BVH.prototype.intersectRay=function(e,t,n){for(var i,r=[this._rootNode],o=[],s=[],a=new $.BVHVector3(1/t.x,1/t.y,1/t.z);r.length>0;){var M=r.pop();if($.BVH.intersectNodeBox(e,a,M))for(M._node0&&r.push(M._node0),M._node1&&r.push(M._node1),i=M._startIndex;i<M._endIndex;i++)o.push(this._bboxArray[7*i])}var u=new $.BVHVector3,c=new $.BVHVector3,l=new $.BVHVector3,d=new $.BVHVector3(e.x,e.y,e.z),N=new $.BVHVector3(t.x,t.y,t.z);for(i=0;i<o.length;i++){var p=o[i];u.setFromArray(this._trianglesArray,9*p),c.setFromArray(this._trianglesArray,9*p+3),l.setFromArray(this._trianglesArray,9*p+6);var h=$.BVH.intersectRayTriangle(u,c,l,d,N,n);h&&s.push({triangle:[u.clone(),c.clone(),l.clone()],triangleIndex:p,intersectionPoint:h})}return s},$.BVH.prototype.calcBoundingBoxes=function(e){for(var t,n,i,r,o,s,a,M,u,c,l,d,N,p,h,D=e.length/9,g=new Float32Array(7*D),y=0;y<D;y++)t=e[9*y],n=e[9*y+1],i=e[9*y+2],r=e[9*y+3],o=e[9*y+4],s=e[9*y+5],a=e[9*y+6],M=e[9*y+7],u=e[9*y+8],c=Math.min(Math.min(t,r),a),l=Math.min(Math.min(n,o),M),d=Math.min(Math.min(i,s),u),N=Math.max(Math.max(t,r),a),p=Math.max(Math.max(n,o),M),h=Math.max(Math.max(i,s),u),$.BVH.setBox(g,y,y,c,l,d,N,p,h);return g},$.BVH.prototype.calcExtents=function(e,t,n){if(n=n||0,e>=t)return[{x:0,y:0,z:0},{x:0,y:0,z:0}];for(var i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=-Number.MAX_VALUE,M=-Number.MAX_VALUE,u=e;u<t;u++)i=Math.min(this._bboxArray[7*u+1],i),r=Math.min(this._bboxArray[7*u+2],r),o=Math.min(this._bboxArray[7*u+3],o),s=Math.max(this._bboxArray[7*u+4],s),a=Math.max(this._bboxArray[7*u+5],a),M=Math.max(this._bboxArray[7*u+6],M);return[{x:i-n,y:r-n,z:o-n},{x:s+n,y:a+n,z:M+n}]},$.BVH.prototype._splitNode=function(e){if(!(e.elementCount()<=this._maxTrianglesPerNode||0===e.elementCount())){var t=e._startIndex,n=e._endIndex,i=[[],[],[]],r=[[],[],[]],o=[e.centerX(),e.centerY(),e.centerZ()],s=[e._extentsMax.x-e._extentsMin.x,e._extentsMax.y-e._extentsMin.y,e._extentsMax.z-e._extentsMin.z],a=[];a.length=3;for(var M=t;M<n;M++){a[0]=.5*(this._bboxArray[7*M+1]+this._bboxArray[7*M+4]),a[1]=.5*(this._bboxArray[7*M+2]+this._bboxArray[7*M+5]),a[2]=.5*(this._bboxArray[7*M+3]+this._bboxArray[7*M+6]);for(var u=0;u<3;u++)a[u]<o[u]?i[u].push(M):r[u].push(M)}var c=[];if(c.length=3,c[0]=0===i[0].length||0===r[0].length,c[1]=0===i[1].length||0===r[1].length,c[2]=0===i[2].length||0===r[2].length,!(c[0]&&c[1]&&c[2])){var l,d,N=[0,1,2];for(N.sort((function(e,t){return s[t]-s[e]})),u=0;u<3;u++){var p=N[u];if(!c[p]){l=i[p],d=r[p];break}}var h,D=t,g=D+l.length,y=g,T=n,z=e._startIndex,j=l.concat(d);for(M=0;M<j.length;M++)h=j[M],$.BVH.copyBox(this._bboxArray,h,this._bboxHelper,z),z++;var f=this._bboxHelper.subarray(7*e._startIndex,7*e._endIndex);this._bboxArray.set(f,7*e._startIndex);var v=this.calcExtents(D,g,$.EPSILON),m=this.calcExtents(y,T,$.EPSILON),w=new $.BVHNode(v[0],v[1],D,g,e._level+1),I=new $.BVHNode(m[0],m[1],y,T,e._level+1);e._node0=w,e._node1=I,e.clearShapes(),this._nodesToSplit.push(w),this._nodesToSplit.push(I)}}},$.BVH._calcTValues=function(e,t,n,i){var r={min:0,max:0};return i>=0?(r.min=(e-n)*i,r.max=(t-n)*i):(r.min=(t-n)*i,r.max=(e-n)*i),r},$.BVH.intersectNodeBox=function(e,t,n){var i=$.BVH._calcTValues(n._extentsMin.x,n._extentsMax.x,e.x,t.x),r=$.BVH._calcTValues(n._extentsMin.y,n._extentsMax.y,e.y,t.y);if(i.min>r.max||r.min>i.max)return!1;(r.min>i.min||i.min!=i.min)&&(i.min=r.min),(r.max<i.max||i.max!=i.max)&&(i.max=r.max);var o=$.BVH._calcTValues(n._extentsMin.z,n._extentsMax.z,e.z,t.z);return!(i.min>o.max||o.min>i.max)&&((o.min>i.min||i.min!=i.min)&&(i.min=o.min),(o.max<i.max||i.max!=i.max)&&(i.max=o.max),!(i.max<0))},$.BVH.intersectRayTriangle=(Z=new $.BVHVector3,J=new $.BVHVector3,X=new $.BVHVector3,K=new $.BVHVector3,function(e,t,n,i,r,o){J.subVectors(t,e),X.subVectors(n,e),K.crossVectors(J,X);var s,a=r.dot(K);if(a>0){if(o)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Z.subVectors(i,e);var M=s*r.dot(X.crossVectors(Z,X));if(M<0)return null;var u=s*r.dot(J.cross(Z));if(u<0)return null;if(M+u>a)return null;var c=-s*Z.dot(K);if(c<0)return null;var l=c/a;return(new $.BVHVector3).copy(r).multiplyScalar(l).add(i)}),$.BVH.setBox=function(e,t,n,i,r,o,s,a,M){e[7*t]=n,e[7*t+1]=i,e[7*t+2]=r,e[7*t+3]=o,e[7*t+4]=s,e[7*t+5]=a,e[7*t+6]=M},$.BVH.copyBox=function(e,t,n,i){n[7*i]=e[7*t],n[7*i+1]=e[7*t+1],n[7*i+2]=e[7*t+2],n[7*i+3]=e[7*t+3],n[7*i+4]=e[7*t+4],n[7*i+5]=e[7*t+5],n[7*i+6]=e[7*t+6]},$.BVH.getBox=function(e,t,n){n.triangleId=e[7*t],n.minX=e[7*t+1],n.minY=e[7*t+2],n.minZ=e[7*t+3],n.maxX=e[7*t+4],n.maxY=e[7*t+5],n.maxZ=e[7*t+6]},$.BVHNode=function(e,t,n,i,r){this._extentsMin=e,this._extentsMax=t,this._startIndex=n,this._endIndex=i,this._level=r,this._node0=null,this._node1=null},$.BVHNode.prototype.elementCount=function(){return this._endIndex-this._startIndex},$.BVHNode.prototype.centerX=function(){return.5*(this._extentsMin.x+this._extentsMax.x)},$.BVHNode.prototype.centerY=function(){return.5*(this._extentsMin.y+this._extentsMax.y)},$.BVHNode.prototype.centerZ=function(){return.5*(this._extentsMin.z+this._extentsMax.z)},$.BVHNode.prototype.clearShapes=function(){this._startIndex=-1,this._endIndex=-1},$.BVHNode.calcBoundingSphereRadius=function(e,t){var n=.5*(e.x+t.x),i=.5*(e.y+t.y),r=.5*(e.z+t.z),o=(n-e.x)*(n-e.x)+(i-e.y)*(i-e.y)+(r-e.z)*(r-e.z),s=(n-t.x)*(n-t.x)+(i-t.y)*(i-t.y)+(r-t.z)*(r-t.z);return Math.sqrt(Math.max(o,s))};var ee=$.BVH,te=window;function ne(e,t,n,i,r){void 0===t&&(t={}),void 0===n&&(n=f),void 0===i&&(i=f),void 0===r&&(r=f);var o=function(e){var t=/jsonp_([0-9a-z]+)([\?\#].*)?$/i.exec(e);return t&&t[0]}(e);if(o){var s=document.createElement("script");return te[o]=function(e){delete te[o],s.parentNode&&s.parentNode.removeChild(s),0!==e.indexOf("data:")&&n(new Error("json needs a dataURL"));var i=e.split(","),r=(i[0].match(/:(.*?);/)||[])[1],a=i[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var M=atob(i[1]),u=M.length,c=new Uint8Array(u),l=0;l<u;l++)c[l]=M.charCodeAt(l);a="arraybuffer"===t.responseType?c.buffer:new Blob([c],{type:r})}O((function(){return n(null,a)}))},s.src=e,document.body.appendChild(s),{abort:function(){delete te[o],s.parentNode&&s.parentNode.removeChild(s)}}}var a=new XMLHttpRequest;function M(){a.ontimeout=f,a.onreadystatechange=f,a.onprogress=f,a.onabort=f}return a.ontimeout=function(){n&&n(new Error("timeout"),null),M()},a.onreadystatechange=function(){4===this.readyState&&(0!==this.status||this.response)&&(200===this.status||0===this.status?(n&&n(null,this.response),M()):(n&&n(new Error("status:"+this.status),null),M()))},a.onprogress=function(e){if(e.lengthComputable){var t=e.loaded,n=e.total;i(t/n,t,n)}},a.onabort=function(){M(),r()},a.open("GET",e,!0),t.responseType&&(a.responseType=t.responseType),a.send(null),a}ne.async=function(e,t){return new Promise((function(n,i){ne(e,t,(function(e,t){return e?i(e):n(t)}))}))};function ie(e,t){if(void 0===t&&(t={}),"function"==typeof t.transform)return t.transform(e,t);if(e.indexOf("//vrlab-public.ljcdn.com")>=0&&(/\.basis(\?|$)/.test(e)&&!0!==t.basisLoaderInitialized&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),/\.(jpg|png)$/.test(e))){var n=t.size,i=t.quality,r=t.format;if(n||i||r){var o="?imageMogr2";i&&(o+="/quality/"+i),n&&(o+="/thumbnail/"+n+"x"),r&&(o+="/format/"+r),e=e.replace("//vrlab-public.ljcdn.com","//vrlab-image4.ljcdn.com")+o}}return e}var re=function(){function e(){}return e.prototype.load=function(e,t,n,i){return void 0===t&&(t=f),void 0===n&&(n=f),void 0===i&&(i=f),this.loadToImage(P(),e,t,n,i)},e.prototype.loadToImage=function(e,t,n,i,r){if(void 0===n&&(n=f),void 0===r&&(r=f),e.src)throw new Error("image is loaded");ne(t,{responseType:"blob"},(function(i,o){i?r(i):(e.onload=function(){n(e),e.onload=e.onerror=function(){}},e.onerror=function(){r(new Error("image parse error "+t)),e.onload=e.onerror=function(){}},e.src=URL.createObjectURL(o))}))},e}(),oe=null,se=!1,ae=[];function Me(e){if(void 0===e&&(e=!1),e||!se)if(oe)se=!1;else{se=!0;var t=ae.shift();if(t){try{t()}catch(e){}O((function(){return Me(!0)}))}else se=!1}}function ue(){oe=null,Me()}function ce(){(oe||0!==ae.length)&&(oe&&clearTimeout(oe),oe=window.setTimeout(ue,200))}function le(e){return new Promise((function(t){ae.push((function(){return t(e())})),Me()}))}var de,Ne={computeTangents:function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var i=t.array,r=n.position.array,o=n.normal.array,s=n.uv.array,a=r.length/3;void 0===n.tangent&&e.setAttribute("tangent",new u.BufferAttribute(new Float32Array(4*a),4));for(var M=n.tangent.array,c=[],l=[],d=0;d<a;d++)c[d]=new u.Vector3,l[d]=new u.Vector3;var N=new u.Vector3,p=new u.Vector3,h=new u.Vector3,D=new u.Vector2,g=new u.Vector2,y=new u.Vector2,T=new u.Vector3,z=new u.Vector3,j=e.groups;0===j.length&&(j=[{start:0,count:i.length}]);d=0;for(var f=j.length;d<f;++d)for(var v=k=(C=j[d]).start,m=k+C.count;v<m;v+=3)U(i[v+0],i[v+1],i[v+2]);var w,I,x,L=new u.Vector3,O=new u.Vector3,A=new u.Vector3,E=new u.Vector3;for(d=0,f=j.length;d<f;++d){var C,k;for(v=k=(C=j[d]).start,m=k+C.count;v<m;v+=3)S(i[v+0]),S(i[v+1]),S(i[v+2])}}else console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function U(e,t,n){N.fromArray(r,3*e),p.fromArray(r,3*t),h.fromArray(r,3*n),D.fromArray(s,2*e),g.fromArray(s,2*t),y.fromArray(s,2*n);var i=p.x-N.x,o=h.x-N.x,a=p.y-N.y,M=h.y-N.y,u=p.z-N.z,d=h.z-N.z,j=g.x-D.x,f=y.x-D.x,v=g.y-D.y,m=y.y-D.y,w=1/(j*m-f*v);T.set((m*i-v*o)*w,(m*a-v*M)*w,(m*u-v*d)*w),z.set((j*o-f*i)*w,(j*M-f*a)*w,(j*d-f*u)*w),c[e].add(T),c[t].add(T),c[n].add(T),l[e].add(z),l[t].add(z),l[n].add(z)}function S(e){A.fromArray(o,3*e),E.copy(A),I=c[e],L.copy(I),L.sub(A.multiplyScalar(A.dot(I))).normalize(),O.crossVectors(E,I),x=O.dot(l[e]),w=x<0?-1:1,M[4*e]=L.x,M[4*e+1]=L.y,M[4*e+2]=L.z,M[4*e+3]=w}},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,i=new Set(Object.keys(e[0].attributes)),r=new Set(Object.keys(e[0].morphAttributes)),o={},s={},a=new u.BufferGeometry,M=0,c=0;c<e.length;++c){var l=e[c];if(n!==(null!==l.index))return null;for(var d in l.attributes){if(!i.has(d))return null;void 0===o[d]&&(o[d]=[]),o[d].push(l.attributes[d])}for(var d in l.morphAttributes){if(!r.has(d))return null;void 0===s[d]&&(s[d]=[]),s[d].push(l.morphAttributes[d])}if(a.userData.mergedUserData=a.userData.mergedUserData||[],a.userData.mergedUserData.push(l.userData),t){var N;if(n)N=l.index.count;else{if(void 0===l.attributes.position)return null;N=l.attributes.position.count}a.addGroup(M,N,c),M+=N}}if(n){var p=0,h=[];for(c=0;c<e.length;++c){for(var D=e[c].index,g=0;g<D.count;++g)h.push(D.getX(g)+p);p+=e[c].attributes.position.count}a.setIndex(h)}for(var d in o){var y=this.mergeBufferAttributes(o[d]);if(!y)return null;a.setAttribute(d,y)}for(var d in s){var T=s[d][0].length;if(0===T)break;a.morphAttributes=a.morphAttributes||{},a.morphAttributes[d]=[];for(c=0;c<T;++c){var z=[];for(g=0;g<s[d].length;++g)z.push(s[d][g][c]);var j=this.mergeBufferAttributes(z);if(!j)return null;a.morphAttributes[d].push(j)}}return a},mergeBufferAttributes:function(e){for(var t,n,i,r=0,o=0;o<e.length;++o){var s=e[o];if(s.isInterleavedBufferAttribute)return null;if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return null;if(void 0===i&&(i=s.normalized),i!==s.normalized)return null;r+=s.array.length}var a=new t(r),M=0;for(o=0;o<e.length;++o)a.set(e[o].array,M),M+=e[o].array.length;return new u.BufferAttribute(a,n,i)},interleaveAttributes:function(e){for(var t,n=0,i=0,r=0,o=e.length;r<o;++r){var s=e[r];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.warn("AttributeBuffers of different types cannot be interleaved"),null;n+=s.array.length,i+=s.itemSize}var a=new u.InterleavedBuffer(new t(n),i),M=0,c=[],l=["getX","getY","getZ","getW"],d=["setX","setY","setZ","setW"],N=0;for(o=e.length;N<o;N++){var p=(s=e[N]).itemSize,h=s.count,D=new u.InterleavedBufferAttribute(a,p,M,s.normalized);c.push(D),M+=p;for(var g=0;g<h;g++)for(var y=0;y<p;y++)D[d[y]](g,s[l[y]](g))}return c},estimateBytesUsed:function(e){var t=0;for(var n in e.attributes){var i=e.getAttribute(n);t+=i.count*i.itemSize*i.array.BYTES_PER_ELEMENT}var r=e.getIndex();return t+=r?r.count*r.itemSize*r.array.BYTES_PER_ELEMENT:0},mergeVertices:function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var n={},i=e.getIndex(),r=e.getAttribute("position"),o=i?i.count:r.count,s=0,a=Object.keys(e.attributes),M={},c={},l=[],d=["getX","getY","getZ","getW"],N=0,p=a.length;N<p;N++){M[z=a[N]]=[],(m=e.morphAttributes[z])&&(c[z]=new Array(m.length).fill().map((function(){return[]})))}var h=Math.log10(1/t),D=Math.pow(10,h);for(N=0;N<o;N++){var g=i?i.getX(N):N,y="",T=0;for(p=a.length;T<p;T++)for(var z=a[T],j=(v=e.getAttribute(z)).itemSize,f=0;f<j;f++)y+=~~(v[d[f]](g)*D)+",";if(y in n)l.push(n[y]);else{for(T=0,p=a.length;T<p;T++){z=a[T];var v=e.getAttribute(z),m=e.morphAttributes[z],w=(j=v.itemSize,M[z]),I=c[z];for(f=0;f<j;f++){var x=d[f];if(w.push(v[x](g)),m)for(var L=0,O=m.length;L<O;L++)I[L].push(m[L][x](g))}}n[y]=s,l.push(s),s++}}var A=e.clone();for(N=0,p=a.length;N<p;N++){z=a[N];var E=e.getAttribute(z),C=new E.array.constructor(M[z]);v=new u.BufferAttribute(C,E.itemSize,E.normalized);if(A.setAttribute(z,v),z in c)for(T=0;T<c[z].length;T++){var k=e.morphAttributes[z][T],U=(C=new k.array.constructor(c[z][T]),new u.BufferAttribute(C,k.itemSize,k.normalized));A.morphAttributes[z][T]=U}}return A.setIndex(l),A}},pe=function(e){function n(t){var n=e.call(this,t)||this;return n._callbacks={},n._initialized=!1,n._taskLoad=0,n}return t.__extends(n,e),n}(Worker),he='\nvar config, transcoderPending, _BasisFile;\nself.onmessage = function(e) {\n var message = e.data;\n switch (message.type) {\n case "init":\n config = message.config;\n init(message.transcoderBinary);\n break;\n case "transcode":\n transcoderPending.then(function() {\n try {\n var result = transcode(message.buffer);\n var width = result.width;\n var height = result.height;\n var hasAlpha = result.hasAlpha;\n var mipmaps = result.mipmaps;\n var format = result.format;\n var buffers = [];\n for (var i = 0; i < mipmaps.length; ++i) {\n buffers.push(mipmaps[i].data.buffer);\n }\n self.postMessage({ type: "transcode", id: message.id, width, height, hasAlpha, mipmaps, format }, buffers);\n } catch (error) {\n console.error(error);\n self.postMessage({ type: "error", id: message.id, error: error.message });\n }\n });\n break;\n default: break;\n }\n};\n\nfunction init(wasmBinary) {\n var BasisModule;\n transcoderPending = new Promise(function(resolve) {\n BasisModule = { wasmBinary, onRuntimeInitialized: resolve };\n BASIS(BasisModule); // eslint-disable-line no-undef\n }).then(function() {\n _BasisFile = BasisModule.BasisFile;\n BasisModule.initializeBasis();\n self.postMessage({ type: "initialized" });\n });\n}\n\nfunction transcode(buffer) {\n var basisFile = new _BasisFile(new Uint8Array(buffer));\n var width = basisFile.getImageWidth(0, 0);\n var height = basisFile.getImageHeight(0, 0);\n var levels = basisFile.getNumLevels(0);\n var hasAlpha = basisFile.getHasAlpha();\n function cleanup() {\n basisFile.close();\n basisFile.delete();\n }\n if (!hasAlpha) {\n switch (config.format) {\n case 9: // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGBA\n config.format = 8; // Hardcoded: BasisTextureLoader.BASIS_FORMAT.cTFPVRTC1_4_RGB;\n break;\n default: break;\n }\n }\n if (!width || !height || !levels) {\n cleanup();\n throw new Error("BasisTextureLoader: Invalid .basis file");\n }\n if (!basisFile.startTranscoding()) {\n cleanup();\n throw new Error("BasisTextureLoader: .startTranscoding failed");\n }\n var mipmaps = [];\n for (var mip = 0; mip < levels; mip++) {\n var mipWidth = basisFile.getImageWidth(0, mip);\n var mipHeight = basisFile.getImageHeight(0, mip);\n var dst = new Uint8Array(basisFile.getImageTranscodedSizeInBytes(0, mip, config.format));\n var status = basisFile.transcodeImage(dst, 0, mip, config.format, 0, hasAlpha);\n if (!status) {\n cleanup();\n throw new Error("BasisTextureLoader: .transcodeImage failed.");\n }\n mipmaps.push({ data: dst, width: mipWidth, height: mipHeight });\n }\n cleanup();\n return { width, height, hasAlpha, mipmaps, format: config.format };\n}\n',De={cTFETC1:0,cTFETC2:1,cTFBC1:2,cTFBC3:3,cTFBC4:4,cTFBC5:5,cTFBC7_M6_OPAQUE_ONLY:6,cTFBC7_M5:7,cTFPVRTC1_4_RGB:8,cTFPVRTC1_4_RGBA:9,cTFASTC_4x4:10,cTFATC_RGB:11,cTFATC_RGBA_INTERPOLATED_ALPHA:12,cTFRGBA32:13,cTFRGB565:14,cTFBGR565:15,cTFRGBA4444:16},ge={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779},ye=((de={})[De.cTFBC1]=ge.COMPRESSED_RGB_S3TC_DXT1_EXT,de[De.cTFBC3]=ge.COMPRESSED_RGBA_S3TC_DXT5_EXT,de),Te=new(function(e){function n(t){var n=e.call(this,t)||this;return n.transcoderPath="",n.transcoderBinary=null,n.transcoderPending=null,n.workerLimit=4,n.workerPool=[],n.workerNextTaskID=1,n.workerSourceURL="",n.workerConfig={format:null,astcSupported:!1,bptcSupported:!1,etcSupported:!1,dxtSupported:!1,pvrtcSupported:!1},n}return t.__extends(n,e),n.prototype.setTranscoderPath=function(e){return this.transcoderPath=e,this},n.prototype.setWorkerLimit=function(e){return this.workerLimit=e,this},n.prototype.isInitialized=function(){return 0!==this.workerPool.filter((function(e){return e._initialized})).length},n.prototype.detectSupport=function(e){var t=this.workerConfig;if(t.astcSupported=!!e.extensions.get("WEBGL_compressed_texture_astc"),t.bptcSupported=!!e.extensions.get("EXT_texture_compression_bptc"),t.etcSupported=!!e.extensions.get("WEBGL_compressed_texture_etc1"),t.dxtSupported=!!e.extensions.get("WEBGL_compressed_texture_s3tc"),t.pvrtcSupported=!!e.extensions.get("WEBGL_compressed_texture_pvrtc")||!!e.extensions.get("WEBKIT_WEBGL_compressed_texture_pvrtc"),t.astcSupported)t.format=n.BASIS_FORMAT.cTFASTC_4x4;else if(t.bptcSupported)t.format=n.BASIS_FORMAT.cTFBC7_M5;else if(t.dxtSupported)t.format=n.BASIS_FORMAT.cTFBC3;else if(t.pvrtcSupported)t.format=n.BASIS_FORMAT.cTFPVRTC1_4_RGBA;else{if(!t.etcSupported)throw new Error("BasisTextureLoader: No suitable compressed texture format found.");t.format=n.BASIS_FORMAT.cTFETC1}return this},n.prototype.load=function(e,t,i,r){var o=this,s=new u.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.load(e,(function(i){var s=i;if(n.taskCache.has(s))return n.taskCache.get(s).promise.then(t).catch(r);o._createTexture(s,e).then(t).catch(r)}),i,r)},n.prototype._createTexture=function(e,t){var i,r,o=this,s=e.byteLength,a=this._allocateWorker(s).then((function(t){return i=t,r=o.workerNextTaskID++,new Promise((function(t,n){i._callbacks[r]={resolve:t,reject:n},i.postMessage({type:"transcode",id:r,buffer:e},[e])}))})).then((function(e){var t,n=o.workerConfig,i=e.width,r=e.height,s=e.mipmaps;switch(e.format){case De.cTFASTC_4x4:t=new u.CompressedTexture(s,i,r,u.RGBA_ASTC_4x4_Format);break;case De.cTFBC1:case De.cTFBC3:t=new u.CompressedTexture(s,i,r,ye[n.format],u.UnsignedByteType);break;case De.cTFETC1:t=new u.CompressedTexture(s,i,r,u.RGB_ETC1_Format);break;case De.cTFPVRTC1_4_RGB:t=new u.CompressedTexture(s,i,r,u.RGB_PVRTC_4BPPV1_Format);break;case De.cTFPVRTC1_4_RGBA:t=new u.CompressedTexture(s,i,r,u.RGBA_PVRTC_4BPPV1_Format);break;default:throw new Error("BasisTextureLoader: No supported format available.")}return t.minFilter=1===s.length?u.LinearFilter:u.LinearMipmapLinearFilter,t.magFilter=u.LinearFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}));return a.catch((function(){return!0})).then((function(){i&&r&&(i._taskLoad-=s,delete i._callbacks[r])})),n.taskCache.set(e,{url:t,promise:a}),a},n.prototype._initTranscoder=function(){var e=this;if(!this.transcoderPending){var t=new u.FileLoader(this.manager);t.setPath(this.transcoderPath);var n=new Promise((function(e,n){t.load("basis_transcoder.js",e,void 0,n)})),i=new u.FileLoader(this.manager);i.setPath(this.transcoderPath),i.setResponseType("arraybuffer");var r=new Promise((function(e,t){i.load("basis_transcoder.wasm",e,void 0,t)}));this.transcoderPending=Promise.all([n,r]).then((function(t){var n=t[0],i=t[1],r=["/* basis_transcoder.js */",n,"/* worker */",he].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([r])),e.transcoderBinary=i}))}return this.transcoderPending},n.prototype._allocateWorker=function(e){var t=this;return this._initTranscoder().then((function(){if(t.workerPool.length<t.workerLimit){var n=new pe(t.workerSourceURL);n._callbacks={},n._initialized=!1,n._taskLoad=0,n.postMessage({type:"init",config:t.workerConfig,transcoderBinary:t.transcoderBinary}),n.onmessage=function(e){var t=e.data;switch(t.type){case"initialized":n._initialized=!0,console.log("BasisTextureLoader: basis loader initialized");break;case"transcode":n._callbacks[t.id].resolve(t);break;case"error":n._callbacks[t.id].reject(t);break;default:console.error('BasisTextureLoader: Unexpected message, "'+t.type+'"')}},t.workerPool.push(n)}else t.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var i=t.workerPool[t.workerPool.length-1];return i._taskLoad+=e,i}))},n.prototype.dispose=function(){for(var e=0;e<this.workerPool.length;e++)this.workerPool[e].terminate();return this.workerPool.length=0,this},n.taskCache=new WeakMap,n.BASIS_FORMAT=De,n.DXT_FORMAT=ge,n.DXT_FORMAT_MAP=ye,n}(u.Loader));Te.setWorkerLimit(1),Te.setTranscoderPath("https://vrlab-public.ljcdn.com/release/static/image/release/five/basis/");var ze=(new u.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);function je(e,t){return new u.BufferAttribute(e,t)}function fe(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function ve(e){var t=e.indices,n=e.vertices,i=e.uvs,r=new u.BufferGeometry;return r.setIndex(je(new Uint32Array(t),1)),r.setAttribute("position",je(new Float32Array(n),3)),j(i)||r.setAttribute("uv",je(new Float32Array(i),2)),r.applyMatrix4(ze),r.computeVertexNormals(),r}function me(e,t){var n=Te.isInitialized();if(e=ie(e,Object.assign({key:"texture",basisLoaderInitialized:n},t)),/\.basis(\?|$)/.test(e)){var i={sourceFile:e,needsUpdate:!0,wrapS:u.ClampToEdgeWrapping,wrapT:u.ClampToEdgeWrapping,minFilter:u.LinearFilter};return new Promise((function(t,n){Te.load(e,(function(e){t(Object.assign(e,i))}),(function(){}),(function(e){n(e.error)}))}))}var r={sourceFile:e,needsUpdate:!0,wrapS:u.ClampToEdgeWrapping,wrapT:u.ClampToEdgeWrapping,minFilter:u.LinearFilter},o=new re;return new Promise((function(t,n){o.load(e,(function(e){var n=new u.Texture(e),i=n.dispose;n.dispose=function(){i.call(n),/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src)},t(Object.assign(n,r))}),f,(function(e){return n(e)}))}))}function we(e){var t=new q;return e.catch((function(){return null})).then((function(e){t.uniforms.map.value=e,t.uniforms.exposure.value=3.3})),t}var Ie=c.parse("\nmessage Model {\n repeated Chunk chunks = 1;\n}\nmessage Chunk {\n required Vertices vertices = 1;\n required Faces faces = 2;\n required string name = 3;\n optional string texture = 4;\n}\nmessage Vertices {\n repeated float xyz = 1 [packed=true];\n repeated float uvs = 2 [packed=true];\n}\nmessage Faces {\n repeated uint32 indices = 1 [packed=true];\n}\n").root.lookup("Model");function xe(e,t,n,i,r){void 0===r&&(r={});for(var o=0,s=e;o<s.length;o++){var a=s[o];a.chunkName=(M=a.name,c=void 0,(c=M.match(/(chunk)-?(\d+)/))?parseInt(c[2],10):0),a.floorName=fe(a.name),a.texture&&(a.texture=n[a.chunkName]=n[a.chunkName]||t+a.texture)}var M,c;e.sort((function(e,t){return 1e3*e.floorName+e.chunkName-(1e3*t.floorName+t.chunkName)}));var l=[],d=[],N=Promise.resolve();return(N=(N=N.then((function(){return le((function(){for(var t=0;t<e.length;t++){var n=e[t],o=fe(n.name),s=l[o]=l[o]||{geometries:[],materials:[]},a=ve({vertices:n.vertices.xyz,uvs:n.vertices.uvs,indices:n.faces.indices});if(a.name="model_geo_chunk_"+t,s.geometries.push(a),n.texture){(M=we(r[n.texture]?r[n.texture]:r[n.texture]=me(n.texture,i))).name="model_mtl_chunk_"+t,s.materials.push(M)}else{var M;(M=new q).defines.USE_MAP=!1,M.uniforms.color.value=new u.Color(16777215),M.name="model_mtl_chunk_"+t,s.materials.push(M)}}}))}))).then((function(){return le((function(){for(var e=0;e<l.length;e++){var t=l[e];if(t){var n=Ne.mergeBufferGeometries(t.geometries,!0);t.geometries.forEach((function(e){return e.dispose()}));var i=new k(n,t.materials);i.floorIndex=e,i.name="model_floor_"+e,d.push(i)}}}))}))).then((function(){var e=Object.keys(r).map((function(e){return r[e].then((function(){}))}));return Promise.all(e).then((function(){return d}))}))}function Le(e,t){return!1!==(e=Object.assign({},e)).autoResize&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>12&&(e.size=Math.min(e.size||1/0,800))),e}var Oe={OutWindow:function(){this._windowSize=0}};Oe.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},Oe.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(0!==e){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},Oe.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},Oe.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},Oe.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},Oe.OutWindow.prototype.copyBlock=function(e,t){var n=this._pos-e-1;for(n<0&&(n+=this._windowSize);t--;)n>=this._windowSize&&(n=0),this._buffer[this._pos++]=this._buffer[n++],this._pos>=this._windowSize&&this.flush()},Oe.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},Oe.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},Oe.RangeDecoder=function(){},Oe.RangeDecoder.prototype.setStream=function(e){this._stream=e},Oe.RangeDecoder.prototype.releaseStream=function(){this._stream=null},Oe.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},Oe.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,n=0,i=e;i--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,n=n<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return n},Oe.RangeDecoder.prototype.decodeBit=function(e,t){var n=e[t],i=(this._range>>>11)*n;return(2147483648^this._code)<(2147483648^i)?(this._range=i,e[t]+=2048-n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,e[t]-=n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},Oe.initBitModels=function(e,t){for(;t--;)e[t]=1024},Oe.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},Oe.BitTreeDecoder.prototype.init=function(){Oe.initBitModels(this._models,1<<this._numBitLevels)},Oe.BitTreeDecoder.prototype.decode=function(e){for(var t=1,n=this._numBitLevels;n--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},Oe.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t,n=1,i=0,r=0;r<this._numBitLevels;++r)n=n<<1|(t=e.decodeBit(this._models,n)),i|=t<<r;return i},Oe.reverseDecode2=function(e,t,n,i){for(var r,o=1,s=0,a=0;a<i;++a)o=o<<1|(r=n.decodeBit(e,t+o)),s|=r<<a;return s},Oe.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new Oe.BitTreeDecoder(8),this._numPosStates=0},Oe.LenDecoder.prototype.create=function(e){for(;this._numPosStates<e;++this._numPosStates)this._lowCoder[this._numPosStates]=new Oe.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new Oe.BitTreeDecoder(3)},Oe.LenDecoder.prototype.init=function(){var e=this._numPosStates;for(Oe.initBitModels(this._choice,2);e--;)this._lowCoder[e].init(),this._midCoder[e].init();this._highCoder.init()},Oe.LenDecoder.prototype.decode=function(e,t){return 0===e.decodeBit(this._choice,0)?this._lowCoder[t].decode(e):0===e.decodeBit(this._choice,1)?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},Oe.Decoder2=function(){this._decoders=[]},Oe.Decoder2.prototype.init=function(){Oe.initBitModels(this._decoders,768)},Oe.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},Oe.Decoder2.prototype.decodeWithMatchByte=function(e,t){var n,i,r=1;do{if(n=t>>7&1,t<<=1,r=r<<1|(i=e.decodeBit(this._decoders,(1+n<<8)+r)),n!==i){for(;r<256;)r=r<<1|e.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},Oe.LiteralDecoder=function(){},Oe.LiteralDecoder.prototype.create=function(e,t){var n;if(!this._coders||this._numPrevBits!==t||this._numPosBits!==e)for(this._numPosBits=e,this._posMask=(1<<e)-1,this._numPrevBits=t,this._coders=[],n=1<<this._numPrevBits+this._numPosBits;n--;)this._coders[n]=new Oe.Decoder2},Oe.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},Oe.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},Oe.Decoder=function(){this._outWindow=new Oe.OutWindow,this._rangeDecoder=new Oe.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new Oe.BitTreeDecoder(4),this._lenDecoder=new Oe.LenDecoder,this._repLenDecoder=new Oe.LenDecoder,this._literalDecoder=new Oe.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new Oe.BitTreeDecoder(6),this._posSlotDecoder[1]=new Oe.BitTreeDecoder(6),this._posSlotDecoder[2]=new Oe.BitTreeDecoder(6),this._posSlotDecoder[3]=new Oe.BitTreeDecoder(6)},Oe.Decoder.prototype.setDictionarySize=function(e){return!(e<0)&&(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},Oe.Decoder.prototype.setLcLpPb=function(e,t,n){var i=1<<n;return!(e>8||t>4||n>4)&&(this._literalDecoder.create(t,e),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},Oe.Decoder.prototype.init=function(){var e=4;for(this._outWindow.init(!1),Oe.initBitModels(this._isMatchDecoders,192),Oe.initBitModels(this._isRep0LongDecoders,192),Oe.initBitModels(this._isRepDecoders,12),Oe.initBitModels(this._isRepG0Decoders,12),Oe.initBitModels(this._isRepG1Decoders,12),Oe.initBitModels(this._isRepG2Decoders,12),Oe.initBitModels(this._posDecoders,114),this._literalDecoder.init();e--;)this._posSlotDecoder[e].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},Oe.Decoder.prototype.decode=function(e,t,n){var i,r,o,s,a,M,u=0,c=0,l=0,d=0,N=0,p=0,h=0;for(this._rangeDecoder.setStream(e),this._outWindow.setStream(t),this.init();n<0||p<n;)if(i=p&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(u<<4)+i))r=this._literalDecoder.getDecoder(p++,h),h=u>=7?r.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(c)):r.decodeNormal(this._rangeDecoder),this._outWindow.putByte(h),u=u<4?0:u-(u<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,u))o=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,u)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(u<<4)+i)&&(u=u<7?9:11,o=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,u)?s=l:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,u)?s=d:(s=N,N=d),d=l),l=c,c=s),0===o&&(o=2+this._repLenDecoder.decode(this._rangeDecoder,i),u=u<7?8:11);else if(N=d,d=l,l=c,o=2+this._lenDecoder.decode(this._rangeDecoder,i),u=u<7?7:10,(a=this._posSlotDecoder[o<=5?o-2:3].decode(this._rangeDecoder))>=4){if(c=(2|1&a)<<(M=(a>>1)-1),a<14)c+=Oe.reverseDecode2(this._posDecoders,c-a-1,this._rangeDecoder,M);else if(c+=this._rangeDecoder.decodeDirectBits(M-4)<<4,(c+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===c)break;return!1}}else c=a;if(c>=p||c>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(c,o),p+=o,h=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},Oe.Decoder.prototype.setDecoderProperties=function(e){var t,n,i,r,o;return!(e.size<5)&&(n=(t=e.readByte())%9,i=(t=~~(t/9))%5,r=~~(t/5),!!this.setLcLpPb(n,i,r)&&(o=e.readByte(),o|=e.readByte()<<8,o|=e.readByte()<<16,o+=16777216*e.readByte(),this.setDictionarySize(o)))},Oe.decompress=function(e,t,n,i){var r=new Oe.Decoder;if(!r.setDecoderProperties(e))throw"Incorrect stream properties";if(!r.decode(t,n,i))throw"Error in data stream";return!0},Oe.decompressFile=function(e,t){var n,i=new Oe.Decoder;if(!i.setDecoderProperties(e))throw"Incorrect stream properties";if(n=e.readByte(),n|=e.readByte()<<8,n|=e.readByte()<<16,n+=16777216*e.readByte(),e.readByte(),e.readByte(),e.readByte(),e.readByte(),!i.decode(e,t,n))throw"Error in data stream";return!0};var Ae="undefined"!=typeof Worker&&"undefined"!=typeof Blob,Ee="";if(Ae)try{var Ce=new Blob(['\n self.onmessage = function (event) {\n var Packet = event.data;\n var Result = null;\n try {\n if (!Packet.PacketID) {\n throw new Error(\'No incoming id.\');\n }\n if (!Packet.Data) {\n throw new Error(\'No input data.\');\n }\n if (Packet.Type == \'compress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n // C: encoding data\n Result = Util.compressFile(Packet.Data, null, Packet.Level, null);\n } else if (Packet.Type == \'decompress\') {\n // C: checking if input is valid\n if (Packet.Data.constructor != Uint8Array) {\n throw new Error(\'Input data is not Uint8Array.\');\n }\n var inStream = {\n data: Packet.Data,\n offset: 0,\n readByte () {\n return this.data[this.offset++];\n }\n };\n var partLength = inStream.data.length;\n var outStream = {\n data: [],\n offset: 0,\n writeByte (value) {\n var partIndex = Math.floor(this.offset / partLength);\n if (!this.data[partIndex]) {\n this.data[partIndex] = new Uint8Array(partLength);\n }\n this.data[partIndex][this.offset % partLength] = value;\n this.offset++;\n }\n }\n // C: decoding data\n\n LZMA.decompressFile(inStream, outStream);\n Result = new Uint8Array(outStream.offset)\n for (var i = 0; i < outStream.offset; i++) {\n Result[i] = outStream.data[Math.floor(i / partLength)][i % partLength];\n }\n }\n postMessage({ PacketID: Packet.PacketID, Result, Error: null }, [Result.buffer]);\n } catch (error) {\n postMessage({ PacketID: Packet.PacketID, Error: error.toString() });\n }\n };\n\n\n /*\n Copyright (c) 2011 Juan Mellado\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the "Software"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n /*\n References:\n - "LZMA SDK" by Igor Pavlov\n http://www.7-zip.org/sdk.html\n */\n\n var LZMA = LZMA || {};\n\n LZMA.OutWindow = function(){\n this._windowSize = 0;\n };\n\n LZMA.OutWindow.prototype.create = function(windowSize){\n if ( (!this._buffer) || (this._windowSize !== windowSize) ){\n this._buffer = [];\n }\n this._windowSize = windowSize;\n this._pos = 0;\n this._streamPos = 0;\n };\n\n LZMA.OutWindow.prototype.flush = function(){\n var size = this._pos - this._streamPos;\n if (size !== 0){\n while(size --){\n this._stream.writeByte(this._buffer[this._streamPos ++]);\n }\n if (this._pos >= this._windowSize){\n this._pos = 0;\n }\n this._streamPos = this._pos;\n }\n };\n\n LZMA.OutWindow.prototype.releaseStream = function(){\n this.flush();\n this._stream = null;\n };\n\n LZMA.OutWindow.prototype.setStream = function(stream){\n this.releaseStream();\n this._stream = stream;\n };\n\n LZMA.OutWindow.prototype.init = function(solid){\n if (!solid){\n this._streamPos = 0;\n this._pos = 0;\n }\n };\n\n LZMA.OutWindow.prototype.copyBlock = function(distance, len){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n while(len --){\n if (pos >= this._windowSize){\n pos = 0;\n }\n this._buffer[this._pos ++] = this._buffer[pos ++];\n if (this._pos >= this._windowSize){\n this.flush();\n }\n }\n };\n\n LZMA.OutWindow.prototype.putByte = function(b){\n this._buffer[this._pos ++] = b;\n if (this._pos >= this._windowSize){\n this.flush();\n }\n };\n\n LZMA.OutWindow.prototype.getByte = function(distance){\n var pos = this._pos - distance - 1;\n if (pos < 0){\n pos += this._windowSize;\n }\n return this._buffer[pos];\n };\n\n LZMA.RangeDecoder = function(){\n };\n\n LZMA.RangeDecoder.prototype.setStream = function(stream){\n this._stream = stream;\n };\n\n LZMA.RangeDecoder.prototype.releaseStream = function(){\n this._stream = null;\n };\n\n LZMA.RangeDecoder.prototype.init = function(){\n var i = 5;\n\n this._code = 0;\n this._range = -1;\n\n while(i --){\n this._code = (this._code << 8) | this._stream.readByte();\n }\n };\n\n LZMA.RangeDecoder.prototype.decodeDirectBits = function(numTotalBits){\n var result = 0, i = numTotalBits, t;\n\n while(i --){\n this._range >>>= 1;\n t = (this._code - this._range) >>> 31;\n this._code -= this._range & (t - 1);\n result = (result << 1) | (1 - t);\n\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n }\n\n return result;\n };\n\n LZMA.RangeDecoder.prototype.decodeBit = function(probs, index){\n var prob = probs[index],\n newBound = (this._range >>> 11) * prob;\n\n if ( (this._code ^ 0x80000000) < (newBound ^ 0x80000000) ){\n this._range = newBound;\n probs[index] += (2048 - prob) >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 0;\n }\n\n this._range -= newBound;\n this._code -= newBound;\n probs[index] -= prob >>> 5;\n if ( (this._range & 0xff000000) === 0){\n this._code = (this._code << 8) | this._stream.readByte();\n this._range <<= 8;\n }\n return 1;\n };\n\n LZMA.initBitModels = function(probs, len){\n while(len --){\n probs[len] = 1024;\n }\n };\n\n LZMA.BitTreeDecoder = function(numBitLevels){\n this._models = [];\n this._numBitLevels = numBitLevels;\n };\n\n LZMA.BitTreeDecoder.prototype.init = function(){\n LZMA.initBitModels(this._models, 1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.decode = function(rangeDecoder){\n var m = 1, i = this._numBitLevels;\n\n while(i --){\n m = (m << 1) | rangeDecoder.decodeBit(this._models, m);\n }\n return m - (1 << this._numBitLevels);\n };\n\n LZMA.BitTreeDecoder.prototype.reverseDecode = function(rangeDecoder){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < this._numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(this._models, m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.reverseDecode2 = function(models, startIndex, rangeDecoder, numBitLevels){\n var m = 1, symbol = 0, i = 0, bit;\n\n for (; i < numBitLevels; ++ i){\n bit = rangeDecoder.decodeBit(models, startIndex + m);\n m = (m << 1) | bit;\n symbol |= bit << i;\n }\n return symbol;\n };\n\n LZMA.LenDecoder = function(){\n this._choice = [];\n this._lowCoder = [];\n this._midCoder = [];\n this._highCoder = new LZMA.BitTreeDecoder(8);\n this._numPosStates = 0;\n };\n\n LZMA.LenDecoder.prototype.create = function(numPosStates){\n for (; this._numPosStates < numPosStates; ++ this._numPosStates){\n this._lowCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n this._midCoder[this._numPosStates] = new LZMA.BitTreeDecoder(3);\n }\n };\n\n LZMA.LenDecoder.prototype.init = function(){\n var i = this._numPosStates;\n LZMA.initBitModels(this._choice, 2);\n while(i --){\n this._lowCoder[i].init();\n this._midCoder[i].init();\n }\n this._highCoder.init();\n };\n\n LZMA.LenDecoder.prototype.decode = function(rangeDecoder, posState){\n if (rangeDecoder.decodeBit(this._choice, 0) === 0){\n return this._lowCoder[posState].decode(rangeDecoder);\n }\n if (rangeDecoder.decodeBit(this._choice, 1) === 0){\n return 8 + this._midCoder[posState].decode(rangeDecoder);\n }\n return 16 + this._highCoder.decode(rangeDecoder);\n };\n\n LZMA.Decoder2 = function(){\n this._decoders = [];\n };\n\n LZMA.Decoder2.prototype.init = function(){\n LZMA.initBitModels(this._decoders, 0x300);\n };\n\n LZMA.Decoder2.prototype.decodeNormal = function(rangeDecoder){\n var symbol = 1;\n\n do{\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.Decoder2.prototype.decodeWithMatchByte = function(rangeDecoder, matchByte){\n var symbol = 1, matchBit, bit;\n\n do{\n matchBit = (matchByte >> 7) & 1;\n matchByte <<= 1;\n bit = rangeDecoder.decodeBit(this._decoders, ( (1 + matchBit) << 8) + symbol);\n symbol = (symbol << 1) | bit;\n if (matchBit !== bit){\n while(symbol < 0x100){\n symbol = (symbol << 1) | rangeDecoder.decodeBit(this._decoders, symbol);\n }\n break;\n }\n }while(symbol < 0x100);\n\n return symbol & 0xff;\n };\n\n LZMA.LiteralDecoder = function(){\n };\n\n LZMA.LiteralDecoder.prototype.create = function(numPosBits, numPrevBits){\n var i;\n\n if (this._coders\n && (this._numPrevBits === numPrevBits)\n && (this._numPosBits === numPosBits) ){\n return;\n }\n this._numPosBits = numPosBits;\n this._posMask = (1 << numPosBits) - 1;\n this._numPrevBits = numPrevBits;\n\n this._coders = [];\n\n i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i] = new LZMA.Decoder2();\n }\n };\n\n LZMA.LiteralDecoder.prototype.init = function(){\n var i = 1 << (this._numPrevBits + this._numPosBits);\n while(i --){\n this._coders[i].init();\n }\n };\n\n LZMA.LiteralDecoder.prototype.getDecoder = function(pos, prevByte){\n return this._coders[( (pos & this._posMask) << this._numPrevBits)\n + ( (prevByte & 0xff) >>> (8 - this._numPrevBits) )];\n };\n\n LZMA.Decoder = function(){\n this._outWindow = new LZMA.OutWindow();\n this._rangeDecoder = new LZMA.RangeDecoder();\n this._isMatchDecoders = [];\n this._isRepDecoders = [];\n this._isRepG0Decoders = [];\n this._isRepG1Decoders = [];\n this._isRepG2Decoders = [];\n this._isRep0LongDecoders = [];\n this._posSlotDecoder = [];\n this._posDecoders = [];\n this._posAlignDecoder = new LZMA.BitTreeDecoder(4);\n this._lenDecoder = new LZMA.LenDecoder();\n this._repLenDecoder = new LZMA.LenDecoder();\n this._literalDecoder = new LZMA.LiteralDecoder();\n this._dictionarySize = -1;\n this._dictionarySizeCheck = -1;\n\n this._posSlotDecoder[0] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[1] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[2] = new LZMA.BitTreeDecoder(6);\n this._posSlotDecoder[3] = new LZMA.BitTreeDecoder(6);\n };\n\n LZMA.Decoder.prototype.setDictionarySize = function(dictionarySize){\n if (dictionarySize < 0){\n return false;\n }\n if (this._dictionarySize !== dictionarySize){\n this._dictionarySize = dictionarySize;\n this._dictionarySizeCheck = Math.max(this._dictionarySize, 1);\n this._outWindow.create( Math.max(this._dictionarySizeCheck, 4096) );\n }\n return true;\n };\n\n LZMA.Decoder.prototype.setLcLpPb = function(lc, lp, pb){\n var numPosStates = 1 << pb;\n\n if (lc > 8 || lp > 4 || pb > 4){\n return false;\n }\n\n this._literalDecoder.create(lp, lc);\n\n this._lenDecoder.create(numPosStates);\n this._repLenDecoder.create(numPosStates);\n this._posStateMask = numPosStates - 1;\n\n return true;\n };\n\n LZMA.Decoder.prototype.init = function(){\n var i = 4;\n\n this._outWindow.init(false);\n\n LZMA.initBitModels(this._isMatchDecoders, 192);\n LZMA.initBitModels(this._isRep0LongDecoders, 192);\n LZMA.initBitModels(this._isRepDecoders, 12);\n LZMA.initBitModels(this._isRepG0Decoders, 12);\n LZMA.initBitModels(this._isRepG1Decoders, 12);\n LZMA.initBitModels(this._isRepG2Decoders, 12);\n LZMA.initBitModels(this._posDecoders, 114);\n\n this._literalDecoder.init();\n\n while(i --){\n this._posSlotDecoder[i].init();\n }\n\n this._lenDecoder.init();\n this._repLenDecoder.init();\n this._posAlignDecoder.init();\n this._rangeDecoder.init();\n };\n\n LZMA.Decoder.prototype.decode = function(inStream, outStream, outSize){\n var state = 0, rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0, nowPos64 = 0, prevByte = 0,\n posState, decoder2, len, distance, posSlot, numDirectBits;\n\n this._rangeDecoder.setStream(inStream);\n this._outWindow.setStream(outStream);\n\n this.init();\n\n while(outSize < 0 || nowPos64 < outSize){\n posState = nowPos64 & this._posStateMask;\n\n if (this._rangeDecoder.decodeBit(this._isMatchDecoders, (state << 4) + posState) === 0){\n decoder2 = this._literalDecoder.getDecoder(nowPos64 ++, prevByte);\n\n if (state >= 7){\n prevByte = decoder2.decodeWithMatchByte(this._rangeDecoder, this._outWindow.getByte(rep0) );\n }else{\n prevByte = decoder2.decodeNormal(this._rangeDecoder);\n }\n this._outWindow.putByte(prevByte);\n\n state = state < 4? 0: state - (state < 10? 3: 6);\n\n }else{\n\n if (this._rangeDecoder.decodeBit(this._isRepDecoders, state) === 1){\n len = 0;\n if (this._rangeDecoder.decodeBit(this._isRepG0Decoders, state) === 0){\n if (this._rangeDecoder.decodeBit(this._isRep0LongDecoders, (state << 4) + posState) === 0){\n state = state < 7? 9: 11;\n len = 1;\n }\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG1Decoders, state) === 0){\n distance = rep1;\n }else{\n if (this._rangeDecoder.decodeBit(this._isRepG2Decoders, state) === 0){\n distance = rep2;\n }else{\n distance = rep3;\n rep3 = rep2;\n }\n rep2 = rep1;\n }\n rep1 = rep0;\n rep0 = distance;\n }\n if (len === 0){\n len = 2 + this._repLenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 8: 11;\n }\n }else{\n rep3 = rep2;\n rep2 = rep1;\n rep1 = rep0;\n\n len = 2 + this._lenDecoder.decode(this._rangeDecoder, posState);\n state = state < 7? 7: 10;\n\n posSlot = this._posSlotDecoder[len <= 5? len - 2: 3].decode(this._rangeDecoder);\n if (posSlot >= 4){\n\n numDirectBits = (posSlot >> 1) - 1;\n rep0 = (2 | (posSlot & 1) ) << numDirectBits;\n\n if (posSlot < 14){\n rep0 += LZMA.reverseDecode2(this._posDecoders,\n rep0 - posSlot - 1, this._rangeDecoder, numDirectBits);\n }else{\n rep0 += this._rangeDecoder.decodeDirectBits(numDirectBits - 4) << 4;\n rep0 += this._posAlignDecoder.reverseDecode(this._rangeDecoder);\n if (rep0 < 0){\n if (rep0 === -1){\n break;\n }\n return false;\n }\n }\n }else{\n rep0 = posSlot;\n }\n }\n\n if (rep0 >= nowPos64 || rep0 >= this._dictionarySizeCheck){\n return false;\n }\n\n this._outWindow.copyBlock(rep0, len);\n nowPos64 += len;\n prevByte = this._outWindow.getByte(0);\n }\n }\n\n this._outWindow.flush();\n this._outWindow.releaseStream();\n this._rangeDecoder.releaseStream();\n\n return true;\n };\n\n LZMA.Decoder.prototype.setDecoderProperties = function(properties){\n var value, lc, lp, pb, dictionarySize;\n\n if (properties.size < 5){\n return false;\n }\n\n value = properties.readByte();\n lc = value % 9;\n value = ~~(value / 9);\n lp = value % 5;\n pb = ~~(value / 5);\n\n if ( !this.setLcLpPb(lc, lp, pb) ){\n return false;\n }\n\n dictionarySize = properties.readByte();\n dictionarySize |= properties.readByte() << 8;\n dictionarySize |= properties.readByte() << 16;\n dictionarySize += properties.readByte() * 16777216;\n\n return this.setDictionarySize(dictionarySize);\n };\n\n LZMA.decompress = function(properties, inStream, outStream, outSize){\n var decoder = new LZMA.Decoder();\n\n if ( !decoder.setDecoderProperties(properties) ){\n throw "Incorrect stream properties";\n }\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n\n LZMA.decompressFile = function(inStream, outStream){\n var decoder = new LZMA.Decoder(), outSize;\n\n if ( !decoder.setDecoderProperties(inStream) ){\n throw "Incorrect stream properties";\n }\n\n outSize = inStream.readByte();\n outSize |= inStream.readByte() << 8;\n outSize |= inStream.readByte() << 16;\n outSize += inStream.readByte() * 16777216;\n\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n inStream.readByte();\n\n if ( !decoder.decode(inStream, outStream, outSize) ){\n throw "Error in data stream";\n }\n\n return true;\n };\n'],{type:"text/javascript"});Ee=URL.createObjectURL(Ce)}catch(e){}var ke=function(){function e(){var e=this;if(this.callCounter=0,this.requests=[],!Ae)throw new Error("LZMACaller cannot work in this broswer.");var t=this.worker=new Worker(Ee);t.onmessage=function(t){var n,i,r=t.data,o=r.PacketID,s=r.Result,a=r.Error;a?null===(i=e.requests[o])||void 0===i||i.onCompleteCallback(new Error(a)):null===(n=e.requests[o])||void 0===n||n.onCompleteCallback(null,s),delete e.requests[o]},t.onerror=function(e){return console.error(e)}}return e.prototype.compress=function(e,t,n){var i=++this.callCounter;this.requests[i]={onCompleteCallback:n},this.worker.postMessage({Type:"compress",PacketID:i,Data:e,Level:t},[e.buffer])},e.prototype.decompress=function(e,t){var n=++this.callCounter;this.requests[n]={onCompleteCallback:t},this.worker.postMessage({Type:"decompress",PacketID:n,Data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=Ae,e}();function Ue(e){return Array.prototype.reduce.call(e,(function(e,t,n){return e|t<<8*n}),0)}function Se(e){for(var t=new Uint8Array(e),n=Ue(t.slice(0,4)),i=[],r=[],o=4+4*n,s=0;s<n;s++)r[s]=Ue(t.slice(4+4*s,8+4*s)),i[s]=s===n-1?t.subarray(o,o+r[s]):t.slice(o,o+r[s]),o+=r[s];return ke.support?function(e){for(var t=[],n=e.length,i=function(n){t.push(new Promise((function(t,i){var r=new ke;r.decompress(e[n],(function(e,n){if(r.terminate(),e)return i(e);t(n)}))})))},r=0;r<n;r++)i(r);return Promise.all(t)}(i):Promise.resolve(function(e){for(var t,n=[],i=e.length,r=function(i){var r={data:e[i],offset:0,readByte:function(){return this.data[this.offset++]}},o=r.data.length,s={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/o);this.data[t]||(this.data[t]=new Uint8Array(o)),this.data[t][this.offset%o]=e,this.offset++}};Oe.decompressFile(r,s),t=new Uint8Array(s.offset);for(var a=0;a<s.offset;a++)t[a]=s.data[Math.floor(a/o)][a%o];n.push(t)},o=0;o<i;o++)r(o);return n}(i))}function be(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:\/\//i.test(e)}var Qe=c.parse("\nmessage Model {\n repeated Mesh meshes = 1;\n}\nmessage Mesh {\n required string name = 1;\n repeated Chunk chunks = 2;\n repeated Matrix matrix = 3;\n}\nmessage Matrix {\n repeated float elements = 1;\n}\nmessage Chunk {\n required Geometry geometry = 2;\n repeated Material material = 3;\n}\nmessage Geometry {\n required Position position = 1;\n optional UV uv = 2;\n optional UV uv2 = 3;\n required Normal normal = 4;\n repeated Group groups = 5;\n}\nmessage Position {\n repeated float array = 1[packed=true];\n}\nmessage UV {\n repeated float array = 1[packed=true];\n}\nmessage Normal {\n repeated float array = 1[packed=true];\n}\nmessage Group {\n required uint32 start = 1;\n required uint32 count = 2;\n required uint32 materialIndex = 3;\n}\nmessage Material {\n optional Color kd = 1;\n optional Color ks = 2;\n optional Color ke = 3;\n optional string mapkd = 4;\n optional string mapks = 5;\n optional string mapke = 6;\n optional string norm = 7;\n optional string mapbump = 8;\n optional string bump = 9;\n optional string mapd = 10;\n optional float ns = 11;\n optional float d = 12;\n optional float tr = 13;\n optional string mapkdrepeat = 14;\n}\nmessage Color {\n repeated float rgb = 1;\n}\n").root.lookup("Model");var Ye={};function Pe(e,t,n){var i,r=[],o=[];function s(e,i,r){var s=function(e){var t=e.position,n=e.normal,i=e.uv,r=e.uv2,o=e.groups,s=new u.BufferGeometry;return s.setAttribute("position",new u.BufferAttribute(new Float32Array(t.array),3)),n&&s.setAttribute("normal",new u.BufferAttribute(new Float32Array(n.array),3)),i&&s.setAttribute("uv",new u.BufferAttribute(new Float32Array(i.array),2)),r&&s.setAttribute("uv2",new u.BufferAttribute(new Float32Array(r.array),2)),o.forEach((function(e){return s.addGroup(e.start,e.count,e.materialIndex)})),s}(e);s.applyMatrix4(r);var a=new u.Vector3,M=new u.Quaternion,c=new u.Vector3;r.decompose(a,M,c),c.x*c.y*c.z<0&&s.attributes.normal&&s.attributes.position&&s.attributes.uv&&function(e){for(var t=[0,0,0],n=0;n<e.attributes.normal.array.length/9;n++)t[0]=e.attributes.normal.array[9*n],t[1]=e.attributes.normal.array[9*n+1],t[2]=e.attributes.normal.array[9*n+2],e.attributes.normal.array[9*n]=e.attributes.normal.array[9*n+6],e.attributes.normal.array[9*n+1]=e.attributes.normal.array[9*n+7],e.attributes.normal.array[9*n+2]=e.attributes.normal.array[9*n+8],e.attributes.normal.array[9*n+6]=t[0],e.attributes.normal.array[9*n+7]=t[1],e.attributes.normal.array[9*n+8]=t[2];for(n=0;n<e.attributes.position.array.length/9;n++)t[0]=e.attributes.position.array[9*n],t[1]=e.attributes.position.array[9*n+1],t[2]=e.attributes.position.array[9*n+2],e.attributes.position.array[9*n]=e.attributes.position.array[9*n+6],e.attributes.position.array[9*n+1]=e.attributes.position.array[9*n+7],e.attributes.position.array[9*n+2]=e.attributes.position.array[9*n+8],e.attributes.position.array[9*n+6]=t[0],e.attributes.position.array[9*n+7]=t[1],e.attributes.position.array[9*n+8]=t[2];for(n=0;n<e.attributes.uv.array.length/6;n++)t[0]=e.attributes.uv.array[6*n],t[1]=e.attributes.uv.array[6*n+1],e.attributes.uv.array[6*n]=e.attributes.uv.array[6*n+4],e.attributes.uv.array[6*n+1]=e.attributes.uv.array[6*n+5],e.attributes.uv.array[6*n+4]=t[0],e.attributes.uv.array[6*n+5]=t[1];e.attributes.normal.needsUpdate=!0,e.attributes.position.needsUpdate=!0,e.attributes.uv.needsUpdate=!0}(s);var l=i.map((function(e){var i=function(e,t,n){var i={sourceFile:null,needsUpdate:!0,wrapS:u.RepeatWrapping,wrapT:u.RepeatWrapping};function r(e,r){return Ye[e]?Promise.resolve(Ye[e]):new Promise((function(o,s){var a=new re;be(e)||(e=t+e),-1!==(e=(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).split("?")[0]).indexOf(".png")&&(e=e.split(".png")[0]+".png"),-1!==e.indexOf(".jpg")&&(e=e.split(".jpg")[0]+".jpg"),0===e.indexOf("//")&&(e="https:"+e),e=ie(e,Object.assign({key:"texture"},n,{size:64})),a.load(e,(function(t){var n=new u.Texture(t),s=n.dispose;n.dispose=function(){s.call(n),/^blob\:/.test(t.src)&&URL.revokeObjectURL(t.src)},r&&Object.assign(n.repeat,r),Object.assign(n,i,{sourceFile:e}),n.updateMatrix(),Ye[e]=n,o(n)}),f,(function(e){return s(e.error)}))}))}var o,s=[],a=new q,M=a.uniforms;if(e.hasOwnProperty("kd")&&(M.diffuse.value=(new u.Color).fromArray(e.kd.rgb)),e.hasOwnProperty("mapkd")){var c=void 0;if(e.mapkdrepeat){var l=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),d=l[0],N=l[1];c=new u.Vector2(d,N)}s.push(r(e.mapkd,c).then((function(e){M.map.value=e,M.exposure.value=4.3,M.uvTransform.value=e.matrix})).catch((function(e){})))}return e.hasOwnProperty("ks")&&(M.specular.value=(new u.Color).fromArray(e.ks.rgb)),e.hasOwnProperty("mapks")&&s.push(r(e.mapks).then((function(e){M.specularMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ke")&&(M.emissive.value=(new u.Color).fromArray(e.ke.rgb)),e.hasOwnProperty("mapke")&&s.push(r(e.mapke).then((function(e){M.emissiveMap.value=e})).catch((function(e){}))),e.hasOwnProperty("norm")&&s.push(r(e.norm).then((function(e){M.normalMap.value=e})).catch((function(e){}))),e.hasOwnProperty("mapbump")&&s.push(r(e.mapbump).then((function(e){M.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("bump")&&s.push(r(e.bump).then((function(e){M.bumpMap.value=e})).catch((function(e){}))),e.hasOwnProperty("ns")&&(M.shininess.value=e.ns),e.hasOwnProperty("d")&&(o=e.d)>=0&&o<1&&(M.originOpacity.value=o),e.hasOwnProperty("tr")&&(o=1-e.tr)>=0&&o<1&&(M.originOpacity.value=o),M.originOpacity.value<1&&(a.transparent=!0),{material:a,textureReady:Promise.all(s).then((function(){}))}}(e,t,n),r=i.material,s=i.textureReady;return o.push(s),r}));return new k(s,l)}return(i=e,Qe.decode(i)).meshes.forEach((function(e){var t=e.name,n=e.chunks,i=e.matrix;"Ceiling"!==t&&"CeilingDrop"!==t&&i.map((function(e){var i,o=new u.Matrix4;if(o.elements=e.elements,1===n.length){var a=n[0],M=a.geometry,c=a.material;i=s(M,c,o)}else i=new S,n.forEach((function(e,t){var n=s(e.geometry,e.material,o);n.name="chunk"+t,i.add(n)}));i.floorIndex=0,i.name=t,r.push(i)}))})),Promise.all(o).catch((function(){})).then((function(){return r}))}function _e(){Object.keys(Ye).forEach((function(e){Ye[e].dispose(),delete Ye[e]}))}function Be(e){return e.$$FIVE_EVENT$$||(e.$$FIVE_EVENT$$={}),e.$$FIVE_EVENT$$}var Re=function(){function e(){}return e.prototype.hasListener=function(e){var t=Be(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var i=this,r=Be(this);return r[e]||(r[e]=[]),r[e].push([t,n||!1]),function(){return i.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,i=Be(this);if(i[e]||(i[e]=[]),void 0!==t){for(var r=0;r<i[e].length&&i[e][r][0]!==t;r++);r<i[e].length&&i[e].splice(r,1)}else i[e].length=0}else(n=this).$$FIVE_EVENT$$||delete n.$$FIVE_EVENT$$},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=!1,r=Be(this),o=r[e]||[],s=0,a=o.slice();s<a.length;s++){var M=a[s],u=M[0],c=M[1],l=void 0!==c&&c,d=u.apply(void 0,t);l&&this.off(e,u),!1===d&&(i=!0)}return i},e}();function Ve(e){var n;return new((n=u.Triangle).bind.apply(n,t.__spreadArray([void 0],e.map((function(e){return new u.Vector3(e.x,e.y,e.z)})))))}var Fe={at3d:function(e,t){t=Le(t,e.textures.length);for(var n={},i=0,r=e.textures;i<r.length;i++){var o=r[i];n[o]=me(o,t)}return Promise.resolve().then((function(){return ne.async(e.file,{responseType:"arraybuffer"})})).then((function(e){return Se(e)})).then((function(e){return le((function(){for(var t=[],n=0,i=e;n<i.length;n++){var r=i[n],o=Ie.decode(r);t.push.apply(t,o.chunks)}return t}))})).then((function(i){return le((function(){return xe(i,e.textureBase,e.textures,t,n)}))}))},pbm:function(e,t){t=Le(t,e.textures.length);for(var n={},i=0,r=e.textures;i<r.length;i++){var o=r[i];n[o]=me(o,t)}return Promise.resolve().then((function(){return ne.async(e.file,{responseType:"arraybuffer"})})).then((function(e){return le((function(){var t=new Uint8Array(e),n=Ie.decode(t);return[].concat(n.chunks)}))})).then((function(i){return le((function(){return xe(i,e.textureBase,e.textures,t,n)}))}))},dome:function(e,t){return Promise.resolve().then((function(){return _e()})).then((function(){return ne.async(e.file,{responseType:"arraybuffer"})})).then((function(n){return Pe(new Uint8Array(n),e.textureBase,t)}))},domez:function(e,t){return Promise.resolve().then((function(){return _e()})).then((function(){return ne.async(e.file,{responseType:"arraybuffer"})})).then((function(e){return Se(e)})).then((function(e){var t=e.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(t),i=0;return e.forEach((function(e){n.set(e,i),i+=e.length})),n})).then((function(n){return Pe(n,e.textureBase,t)}))}},qe=function(e){function n(){var t=e.call(this)||this;return t.empty=!1,t.name="model",t.loaded=!1,t.bvhs=[],t.bounding=new u.Box3,t.shownFloor=null,t.floorLength=0,t}return t.__extends(n,e),Object.defineProperty(n.prototype,"shownfloor",{get:function(){return this.shownFloor},enumerable:!1,configurable:!0}),n.prototype.getEdges=function(e){var t;void 0===e&&(e=30/180*Math.PI);for(var n=Math.cos(e),i=[],r=0,o=this.children;r<o.length;r++){var s=o[r];if(s instanceof k){for(var a={},M=["a","b","c"],c=Ne.mergeVertices(s.geometry),l=c.getAttribute("position").array,d=(null===(t=c.getIndex())||void 0===t?void 0:t.array)||[],N=[],p=[],h=0,D=l.length;h<D;h+=3)N.push(new u.Vector3(l[h],l[h+1],l[h+2]));for(h=0,D=d.length;h<D;h+=3){var g=d[h],y=d[h+1],T=d[h+2],z=(new u.Vector3).crossVectors(N[y].clone().sub(N[g]),N[T].clone().sub(N[g])).normalize();p.push({a:g,b:y,c:T,normal:z})}for(h=0,D=p.length;h<D;h++)for(var j=p[h],f=0;f<3;f++){var v=j[M[f]],m=j[M[(f+1)%3]],w=[Math.min(v,m),Math.max(v,m)];void 0===a[I=w[0]+"-"+w[1]]?a[I]={index1:w[0],index2:w[1],face1:h}:a[I].face2=h}for(var I in a){var x=a[I];if(void 0===x.face2||p[x.face1].normal.dot(p[x.face2].normal)<=n){var L=N[x.index1],O=N[x.index2];i.push(new u.Line3(L,O))}}c.dispose(),N.length=0,p.length=0}}return i},n.prototype.hasFloors=function(){return this.hasFloors_()},n.prototype.hasFloors_=function(){var e=[];return this.traverse((function(t){t instanceof k&&(e[t.floorIndex]=!0)})),e.length},n.prototype.show=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this.shownFloor,r=null,o=null!==(e=t[1])&&void 0!==e?e:.1,s=0!==t.length;this.shownFloor=r=s?t[0]:null,this.traverse((function(e){e instanceof k&&e.material.forEach((function(t){null===r||r===e.floorIndex?t.opacity=1:t.opacity=o}))})),i!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0},n.prototype.intersectRaycaster=function(e,t){var n=e.ray,i=n.origin,r=n.direction;if(j(t))if(j(this.shownFloor)){var o=this.floorLength;t=[];for(var s=0;s<o;s++)t.push(s)}else t=[this.shownFloor];var a=[],M=[];Array.isArray(t)?M.push.apply(M,t):M.push(t);for(var c=function(t){var n=l.bvhs&&l.bvhs[t];if(n){(o=n.intersectRay(i,r,!0).map((function(e){var t=e.intersectionPoint,n=e.triangle,r=new u.Vector3(t.x,t.y,t.z);return{point:r,face:{normal:Ve(n).getNormal(new u.Vector3)},distance:i.distanceTo(r)}}))).length&&a.push.apply(a,o)}else{var o,s=[];l.traverse((function(e){e instanceof k&&e.floorIndex===t&&s.push(e)})),(o=e.intersectObjects(s).map((function(e){var t=e.face?{normal:e.face.normal}:void 0;return{point:e.point,face:t,distance:e.distance}}))).length&&a.push.apply(a,o)}},l=this,d=0,N=M;d<N.length;d++){c(N[d])}return a.filter((function(t){var n=t.distance;return n<=e.far&&n>=e.near})).sort((function(e,t){return e.distance-t.distance}))},n.prototype.buildBVH=function(){var e=this,t=[];this.traverse((function(e){e instanceof k&&(t[e.floorIndex]=t[e.floorIndex]||[],t[e.floorIndex].push(e.geometry))}));var n=t.map((function(e){var t=e.reduce((function(e,t){return e+(t.index?t.index.array.length:t.attributes.position.array.length)}),0),n=new Float32Array(3*t);return e.reduce((function(e,t){for(var i=t.index?t.index.array:null,r=t.attributes.position.array,o=i?i.length:r.length/3,s=0;s<o;s++){var a=3*(e+s),M=i?3*i[s]:3*s;n[a+0]=r[M+0],n[a+1]=r[M+1],n[a+2]=r[M+2]}return e+o}),0),new ee(n,5)}));return this.bvhs=[],Promise.all(n.map((function(e){return new Promise((function(t){return e.splitNode(t)}))}))).then((function(){e.bvhs=n,e.bvhs.loaded=!0,e.emit("bvhLoaded")}))},n.prototype.load=function(e,t){var n=this;if(void 0===t&&(t={}),!0===this.loaded)throw new Error("model 只能被 load 一次");var i=Fe[function(e,t){void 0===t&&(t=[]);var n=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(n)for(var i=String(n[1]).trim().split("."),r=0,o=t;r<o.length;r++){var s=o[r];if(i.indexOf(s)>=0)return s}}(e.file,Object.keys(Fe))||""];if(!i)throw new Error("文件类型错误");i(e,t).then((function(e){for(var t=[],i=0,r=e;i<r.length;i++){(M=r[i]).traverse((function(e){e instanceof k&&(e.geometry.computeBoundingBox(),e.geometry.computeBoundingSphere(),t.push(e.geometry.boundingBox))})),n.add(M)}n.floorLength=n.hasFloors_(),n.bounding=function(e){for(var t=new u.Box3,n=0,i=e;n<i.length;n++){var r=i[n];t.union(r)}return t}(t);for(var o=n.bounding.getCenter(new u.Vector3),s=0,a=e;s<a.length;s++){var M;(M=a[s]).traverse((function(e){e instanceof k&&e.material.forEach((function(e){e.uniforms.modelCenter.value=o}))}))}t.length=0,n.emit("geometryLoaded"),n.emit("materialLoaded"),n.loaded=!0,O((function(){return n.emit("loaded")}))})).catch((function(e){n.emit("error",e)}))},n.prototype.dispose=function(){for(this.off(),this.disposeGeometry(),this.disposeMaterial();this.children.length;)this.remove(this.children[0]);this.bvhs.length=0,delete this.bvhs.loaded},n}(U);function He(e){switch(e.getError()){case e.INVALID_ENUM:return new Error("webgl error: INVALID_ENUM");case e.INVALID_VALUE:return new Error("webgl error: INVALID_VALUE");case e.INVALID_OPERATION:return new Error("webgl error: INVALID_OPERATION");case e.INVALID_FRAMEBUFFER_OPERATION:return new Error("webgl error: INVALID_FRAMEBUFFER_OPERATION");case e.OUT_OF_MEMORY:return new Error("webgl error: OUT_OF_MEMORY");case e.CONTEXT_LOST_WEBGL:return new Error("webgl error: CONTEXT_LOST_WEBGL");default:return null}}Object.assign(qe.prototype,{on:Re.prototype.on,once:Re.prototype.once,off:Re.prototype.off,emit:Re.prototype.emit,hasListener:Re.prototype.hasListener});var Ge=document.head||document.getElementsByTagName("head")[0],We={};var Ze=l.default.Tween,Je=l.default.Easing;function Xe(e,t,n,i){void 0===i&&(i=Je.Linear.None);var r=[],o=[],s=[],a=[],M=Object.assign(new Ze(e).to(t,n).easing(i),{completed:!1,onCancel:function(e){return r.push(e),M},destroy:function(){if(M.stop(),Object.assign(this,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallback:null}),!M.completed)for(var e=0,t=r;e<t.length;e++){(0,t[e])()}r.length=0,u()}});Object.assign(M,{onStart:function(e){return o.push(e),M},onUpdate:function(e){return s.push(e),M},onComplete:function(e){return a.push(e),M},_onStartCallback:function(e){for(var t=0,n=o;t<n.length;t++){(0,n[t])(e)}},_onUpdateCallback:function(e,t){for(var n=0,i=s;n<i.length;n++){(0,i[n])(e,t)}1===t&&0===M._repeat&&(M.completed=!0)},_onCompleteCallback:function(e){for(var t=0,n=a;t<n.length;t++){(0,n[t])(e)}}}),O((function(){return M.start()}));var u=A((function(e){!1===M.update(e)&&u()}));return M}function Ke(e,t){return Xe({progress:0},{progress:1},e,t)}var $e=2*Math.PI;function et(e){return(e%$e+$e)%$e}var tt=Math.PI,nt=2*tt;function it(e,t,n){return e+(t-e)*n}function rt(e,t,n){return e=et(e),it((t=et(t))-e>tt?e+nt:e-t>tt?e-nt:e,t,n)}function ot(e,t,n){if(e===t)return t;var i=t-e;return Math.abs(i)<=n?t:e+(i>0?1:-1)*n}function st(e){return"number"==typeof e}function at(e){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var t={uuid:m(),initial:{mode:"Panorama",latitude:0,longitude:0,panoIndex:0,fov:80},observers:[]},n=e.base_url||"",i=function(t,i){var r,o;if(be(t))return t;var s=(null===(r=e.panorama)||void 0===r?void 0:r.base_url)||n||"",a=(null===(o=e.panorama)||void 0===o?void 0:o.pano_high_cube_base_url)||"";return a||s?s+a+i+"/"+t:n+t},r=function(e){return be(e)?e:n+e},o=function(e,t){return be(e)?e:t?t+e:n+e};if(e.initial&&("Floorplan"!==e.initial.mode&&"Topview"!==e.initial.mode&&"Panorama"!==e.initial.mode&&"VRPanorama"!==e.initial.mode&&"Model"!==e.initial.mode&&"DepthPanorama"!==e.initial.mode||(t.initial.mode=e.initial.mode),st(e.initial.latitude)&&(t.initial.latitude=e.initial.latitude),st(e.initial.longitude)?t.initial.longitude=e.initial.longitude:st(e.initial.heading)&&(t.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),st(e.initial.fov)&&(t.initial.fov=e.initial.fov),st(e.initial.panoIndex)?t.initial.panoIndex=e.initial.panoIndex:st(e.initial.pano_index)?t.initial.panoIndex=e.initial.pano_index:st(e.initial.pano)&&(t.initial.panoIndex=e.initial.pano)),e.model){var s={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof e.model.bvh?s.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(s.bvh=e.bvh),"boolean"==typeof e.model.async?s.async=e.model.async:"boolean"==typeof e.modelAsync&&(s.async=e.modelAsync),e.model.file?s.file=r(e.model.file):e.model.file_url&&(s.file=r(e.model.file_url)),e.model.textureBase?s.textureBase=e.model.textureBase:e.model.material_base_url&&(s.textureBase=e.model.material_base_url),Array.isArray(e.model.textures)?s.textures=e.model.textures.map((function(e){return o(e,s.textureBase)})):Array.isArray(e.model.material_textures)&&(s.textures=e.model.material_textures.map((function(e){return o(e,s.textureBase)}))),s.file&&(t.model=s)}if(e.observers&&Array.isArray(e.observers)){var a=[];e.panorama&&(Array.isArray(e.panorama)?a=e.panorama:Array.isArray(e.panorama.list)?a=e.panorama.list:Array.isArray(e.panorama.info)&&(a=e.panorama.info));for(var M=0;M<e.observers.length;M++){var c={},l=e.observers[M];if(!l)break;var d=a[M]||{};l=Object.assign({},l,d,{active:!1!==l.active&&!1!==d.active}),c.panoIndex=M,c.active=!1!==l.active,c.loadable=!0===l.loadable,c.images={up:i(l.images?l.images.up:l.up,M),down:i(l.images?l.images.down:l.down,M),right:i(l.images?l.images.right:l.right,M),left:i(l.images?l.images.left:l.left,M),front:i(l.images?l.images.front:l.front,M),back:i(l.images?l.images.back:l.back,M)};var N=l.images?l.images.depth:l.depth;N&&(c.images.depth=i(N,M));var p=l.images?l.images.tiles:l.tiles;if(p&&(c.images.tiles=i(p,M)),l.position instanceof u.Vector3)c.position=l.position.clone();else{if(!Array.isArray(l.position))break;c.position=(new u.Vector3).fromArray(l.position)}if(l.standingPosition instanceof u.Vector3)c.standingPosition=l.standingPosition.clone();else if(Array.isArray(l.standingPosition))c.standingPosition=(new u.Vector3).fromArray(l.standingPosition);else if(l.standing_position instanceof u.Vector3)c.standingPosition=l.standing_position.clone();else{if(!Array.isArray(l.standing_position))break;c.standingPosition=(new u.Vector3).fromArray(l.standing_position)}if(l.quaternion instanceof u.Quaternion)c.quaternion=l.quaternion.clone();else if(Array.isArray(l.quaternion))c.quaternion=(new u.Quaternion).fromArray(l.quaternion);else{if(!l.quaternion)break;var h=l.quaternion,D=h.x,g=h.y,y=h.z,T=h.w;c.quaternion=new u.Quaternion(D,g,y,T)}if(Array.isArray(l.accessibleNodes)?c.accessibleNodes=l.accessibleNodes.slice():Array.isArray(l.accessible_nodes)&&(c.accessibleNodes=l.accessible_nodes.slice()),Array.isArray(l.visibleNodes)?c.visibleNodes=l.visibleNodes.slice():Array.isArray(l.visible_nodes)&&(c.visibleNodes=l.visible_nodes.slice()),st(l.floorIndex)?c.floorIndex=l.floorIndex:st(l.floor_index)?c.floorIndex=l.floor_index:c.floorIndex=0,l.video){var z={};"string"==typeof l.video.source&&(z.source=l.video.source),l.video.matrix instanceof u.Matrix4?z.matrix=l.video.matrix.clone():Array.isArray(l.video.matrix)&&(z.matrix=(new u.Matrix4).fromArray(l.video.matrix)),l.video.size instanceof u.Vector2?z.size=l.video.size.clone():Array.isArray(l.video.size)&&(z.size=(new u.Vector2).fromArray(l.video.size)),z.source&&z.matrix&&z.size&&(c.video=z)}t.observers[M]=c}}for(var j=0,f=t.observers;j<f.length;j++){if(!(c=f[j]).accessibleNodes){c.accessibleNodes=[];for(var v=0;v<t.observers.length;v++)t.observers[v]!==c&&c.accessibleNodes.push(v)}if(!c.visibleNodes){c.visibleNodes=[];for(v=0;v<t.observers.length;v++)t.observers[v]!==c&&c.visibleNodes.push(v)}}return Object.freeze(t),t}var Mt=function(e){return Number(e)};function ut(e,t,n){var i;void 0===t&&(t=Mt),void 0===n&&(n=!1);for(var r,o=1/0,s=0,a=e;s<a.length;s++){var M=a[s],u=t(M);u<=o&&(r=(i=[M,u])[0],o=i[1])}return n?[r,o]:r}var ct=document.mozFullScreen?"DOMMouseScroll":"mousewheel",lt=!!window.addEventListener,dt=!!window.attachEvent;function Nt(e,t){var n=function(e,t){return t.__mouseWheelWrapper=function(n){if(n=n||window.event,lt&&n.preventDefault(),dt&&(n.returnValue=!1),"DOMMouseScroll"==ct||"mousewheel"==ct){var i=n.wheelDelta;n.delta=i?i/120:-(n.delta||0)/3}t.call(e,n)}}(e,t);lt?e.addEventListener(ct,n,!1):dt&&e.attachEvent("on"+ct,n)}function pt(e,t,n){var i=t.offsetWidth,r=t.offsetHeight,o=t.getBoundingClientRect(),s=o.top,a=o.left;return n&&(a+=i*n.left,s+=r*(1-n.bottom-n.height),i*=n.width,r*=n.height),new u.Vector2((e.x-a)/i*2-1,-(e.y-s)/r*2+1)}var ht=navigator.userAgent.toLowerCase(),Dt=document.createElement("canvas");!function(){try{!window.WebGLRenderingContext||!Dt.getContext("webgl")&&Dt.getContext("experimental-webgl")}catch(e){return!1}}();var gt=ht.match(/android/i)||ht.match(/webos/i)||ht.match(/ipad|iphone|ipod/i)||ht.match(/iemobile/i)||ht.match(/opera mini/i)||ht.match(/blackberry/i)||ht.match(/windows phone/i),yt=function(e){function n(t){var i=e.call(this)||this,r=n.parseArgs(t);return i.ready=!1,i.destroyed=!1,i.ident=r.ident,i.scene=r.scene,i.helper=r.helper,i.camera=r.camera,i.renderer=r.renderer,i.scissor=r.scissor,i.element=r.element,i.model=r.model,i.work=r.work,i.imageOptions=r.imageOptions,i.videoTexture=r.videoTexture,i.needsRender=!0,i.preventPanGesture=!1,i.preventTapGesture=!1,i.preventPinchGesture=!1,i.currentPanoIndex=r.panoIndex,j(i.work.observers[i.currentPanoIndex])&&(i.currentPanoIndex=0),i.eventUnbinds=[r.element].concat(r.extraElements||[]).map((function(e){return i.bindEvents(e)})),O((function(){return i.initAnimation.apply(i,r.initial).then((function(){return i.ready=!0}))})),i}return t.__extends(n,e),n.parseArgs=function(e){return t.__assign({},e)},n.initAnimationEndPose=function(e){return this.parseArgs(e).camera.copyPose()},n.prototype.initAnimation=function(e,t,n){return Promise.resolve()},n.prototype.bindExtraElement=function(e){for(var t=0,n=this.eventUnbinds;t<n.length;t++){if(n[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},n.prototype.unbindExtraElement=function(e){for(var t=null,n=-1,i=0,r=this.eventUnbinds;i<r.length;i++){var o=r[i];if(n++,o.element===e){t=o;break}}t&&(t(),this.eventUnbinds.splice(n,1))},n.prototype.resize=function(){this.needsRender=!0},n.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0},n.prototype.updateWork=function(e,t,n,i){return!1},n.prototype.render=function(e){this.renderer.render(this.scene,this.camera)},n.prototype.destroy=function(){this.destroyed=!0,this.ready=!1,this.off();for(var e=0,t=this.eventUnbinds;e<t.length;e++){(0,t[e])()}this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenCoordinates)},n.prototype.moveToPano=function(e,t,n){void 0===t&&(t={});var i={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()};t.moveStartCallback&&t.moveStartCallback(e,i),this.emit("moveToPano",e,n),this.currentPanoIndex=e,this.emit("panoArrived",e,{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},n),t.moveEndCallback&&t.moveEndCallback(e,i)},n.prototype.updateCamera=function(e,t,n){var i,r,o,s;void 0===e&&(e={});var a=null!==(i=e.longitude)&&void 0!==i?i:this.camera.pose.longitude,M=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,u=null!==(o=e.fov)&&void 0!==o?o:this.camera.pose.fov,c=null!==(s=e.offset)&&void 0!==s?s:this.camera.pose.offset,l=a!==this.camera.pose.longitude||M!==this.camera.pose.latitude,d=u!==this.camera.pose.fov,N=!c.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:M,fov:u,offset:c}),d&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),l&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),N&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(d||l||N)&&this.emit("cameraUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:this.camera.pose.offset.clone()},t),this.needsRender=!0},n.prototype.onPanGesture=function(e){},n.prototype.onTapGesture=function(e){},n.prototype.onPinchGesture=function(e){},n.prototype.onMouseWheel=function(e){},n.prototype.onMouseMove=function(e){},n.prototype.onMouseOut=function(){},n.prototype.relativeClientPosition=function(e){return pt(e,this.element,this.scissor)},n.prototype.bindEvents=function(e){var t=this,n=function(e){var n=pt(e,t.element,t.scissor);return!(Math.abs(n.x)>1||Math.abs(n.y)>1)},i=new Hammer.Manager(e),r=function(e){return e.session.firstInput||null};i.add(new Hammer.Pan({threshold:10,pointers:0})),i.add(new Hammer.Tap({interval:410})),i.add(new Hammer.Pinch({threshold:0,pointers:2}).recognizeWith(i.get("pan"))),i.on("panstart pan",(function(e){var o=r(i);o&&!n(o.center)||!0!==t.preventPanGesture&&t.onPanGesture(e)})),i.on("tap",(function(e){var o=r(i);o&&!n(o.center)||!0!==t.preventTapGesture&&t.onTapGesture(e)})),i.on("pinchstart pinch pinchend",(function(e){var o=r(i);o&&!n(o.center)||!0!==t.preventPinchGesture&&t.onPinchGesture(e)}));var o=function(e){var i={x:e.clientX,y:e.clientY};n(i)&&t.onMouseWheel(e)},s=function(e){var i={x:e.clientX,y:e.clientY};n(i)?t.onMouseMove(e):t.onMouseOut()},a=function(){t.onMouseOut()};Nt(e,o),gt||(Hammer.on(e,"mousemove",s),Hammer.on(e,"mouseout",a));return Object.assign((function(){i.destroy(),function(e,t){t.__mouseWheelWrapper&&(lt?e.removeEventListener(ct,t.__mouseWheelWrapper,!1):dt&&e.detachEvent("on"+ct,t.__mouseWheelWrapper),delete t.__mouseWheelWrapper)}(e,o),gt||(Hammer.off(e,"mousemove",s),Hammer.off(e,"mouseout",a))}),{element:e})},n}(Re),Tt=function(e){function n(t){var i=this,r=n.parseArgs(t);return(i=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,i.defaultLatitude=r.defaultLatitude,i.defaultFov=r.defaultFov,i.maxFov=r.maxFov,i.minFov=r.minFov,i.maxLatitude=r.maxLatitude,i.minLatitude=r.minLatitude,i}return t.__extends(n,e),n.parseArgs=function(n){var i,r,o,s,a,M,u,c=e.parseArgs.call(this,n);return t.__assign(t.__assign({},c),{defaultLongitude:null!==(i=n.defaultLongitude)&&void 0!==i?i:Math.PI/4,defaultLatitude:null!==(r=n.defaultLatitude)&&void 0!==r?r:Math.PI/4,defaultFov:null!==(o=n.defaultFov)&&void 0!==o?o:80,maxFov:null!==(s=n.maxFov)&&void 0!==s?s:120,minFov:null!==(a=n.minFov)&&void 0!==a?a:40,maxLatitude:null!==(M=n.maxLatitude)&&void 0!==M?M:+Math.PI/2,minLatitude:null!==(u=n.minLatitude)&&void 0!==u?u:-Math.PI/2})},n.initAnimationEndPose=function(e){var t,i,r,o=this.parseArgs(e),s=e.initial[0],a=null!==(t=s.longitude)&&void 0!==t?t:o.defaultLongitude,M=Math.max(o.minLatitude,Math.min(o.maxLatitude,null!==(i=s.latitude)&&void 0!==i?i:o.defaultLatitude)),u=null!==(r=s.fov)&&void 0!==r?r:o.defaultFov,c=n.prototype.cameraDistance.call(o);return{longitude:a,latitude:M,fov:u,offset:n.prototype.calculateCameraPosition.call(o,{longitude:M,latitude:M},c,null,!1).clone()}},n.prototype.destroy=function(){e.prototype.destroy.call(this)},n.prototype.updateWork=function(e,t,n,i){return this.work=e,this.currentPanoIndex=t.panoIndex,!0},n.prototype.resetModel=function(t,n){e.prototype.resetModel.call(this,t,n),this.updateCamera({longitude:this.defaultLongitude,latitude:this.defaultLatitude,fov:this.defaultFov},n,!1)},n.prototype.initAnimation=function(e,t,n){var i,r,o,s,a,M,c=this;if(this.destroyed)return Promise.resolve();var l=this.camera,d=this.model;this.preventPanGesture=!0,this.preventTapGesture=!0,this.preventPinchGesture=!0;var N=l.pose.longitude,p=l.pose.latitude,h=l.pose.fov,D=l.pose.offset.clone(),g=(null===(i=d.getMaterial())||void 0===i?void 0:i.modelAlpha)||0,y=null!==(o=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==o?o:0,T=null!==(s=e.longitude)&&void 0!==s?s:this.defaultLongitude,z=Math.max(this.minLatitude,Math.min(this.maxLatitude,null!==(a=e.latitude)&&void 0!==a?a:this.defaultLatitude)),j=null!==(M=e.fov)&&void 0!==M?M:this.defaultFov,f=d.bounding.getCenter(new u.Vector3),v=this.cameraDistance(),m=this.calculateCameraPosition({longitude:z,latitude:z},v,null,!1),w={longitude:T,latitude:z,fov:j,offset:m.clone()};return this.emit("initAnimationWillStart",this.currentPanoIndex,w,n),new Promise((function(e){c.tweenCoordinates&&(c.tweenCoordinates.destroy(),delete c.tweenCoordinates);var i=function(e){var t=e.progress,i=rt(N,T,t),r=it(p,z,t),o=it(h,j,t);c.updateCamera({longitude:i,latitude:r,fov:o,offset:c.camera.pose.offset},n,!1)},r=function(){i({progress:1}),c.tweenCoordinates&&(c.tweenCoordinates.destroy(),delete c.tweenCoordinates)};t>0?c.tweenCoordinates=Ke(t,Je.Quadratic.InOut).onUpdate(i).onComplete(r):r(),c.tweenPosition&&(c.tweenPosition.destroy(),delete c.tweenPosition);var o=function(e){var t=e.progress,i=it(0,v,t),r=new u.Vector3(it(D.x-f.x,0,t),it(D.y-f.y,0,t),it(D.z-f.z,0,t)),o=it(g,1,t),s=it(y,0,t);d.setMaterial({modelAlpha:o,perspToOrtho:s});var a=c.calculateCameraPosition(c.camera.pose,i,r,!1);c.updateCamera({offset:a},n,!1)};r=function(){o({progress:1}),c.updateCamera(c.camera.copyPose(),n,!1),c.tweenPosition&&(c.tweenPosition.destroy(),delete c.tweenPosition),c.needsRender=!0,c.preventPanGesture=!1,c.preventTapGesture=!1,c.preventPinchGesture=!1,e(),c.emit("initAnimationEnded",c.currentPanoIndex,c.camera.copyPose(),n)};t>0?c.tweenPosition=Ke(t,Je.Quadratic.InOut).onUpdate(o).onComplete(r).onCancel((function(){c.preventPanGesture=!1,c.preventTapGesture=!1,c.preventPinchGesture=!1,e(),c.emit("initAnimationEnded",c.currentPanoIndex,c.camera.copyPose(),n)})):r()}))},n.prototype.cameraDistance=function(){var e=this.model.bounding,t=this.camera.aspect,n=Math.pow(Math.pow(e.max.x-e.min.x+2,2)+Math.pow(e.max.y-e.min.y+2,2)+Math.pow(e.max.z-e.min.z+2,2),.5),i=n/2/Math.tan(Math.PI*this.defaultFov/360);return t<1&&(i/=t),isNaN(i)?n:i},n.prototype.calculateCameraPosition=function(e,t,n,i){var r=e.longitude,o=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.latitude));i&&(o=Math.max(this.minLatitude,Math.min(this.maxLatitude,o)));var s=this.model.bounding.getCenter(new u.Vector3),a=t*Math.cos(o),M=new u.Vector3(Math.sin(r)*a+s.x,Math.sin(o)*t+s.y,Math.cos(r)*a+s.z);return null!==n&&M.add(n),M},n.prototype.updateCamera=function(e,t,n){var i,r,o;void 0===e&&(e={});var s=this,a=s.minFov,M=s.maxFov,u=s.maxLatitude,c=s.minLatitude,l=null!==(i=e.longitude)&&void 0!==i?i:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,N=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,p=null!==(o=e.offset)&&void 0!==o?o:this.calculateCameraPosition({longitude:l,latitude:d},this.cameraDistance(),null,n);n&&(d=Math.max(c,Math.min(u,d)),N=Math.max(a,Math.min(M,N)));var h=l!==this.camera.pose.longitude||d!==this.camera.pose.latitude,D=N!==this.camera.pose.fov,g=!p.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:l,latitude:d,fov:N,offset:p}),D&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),h&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),g&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(D||h||g)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,ce()},n.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),n=this.model.intersectRaycaster(e)[0];if(!n)return null;var i=ut(t,(function(e){return e.standingPosition.distanceTo(n.point)}),!0),r=i[0];return i[1]<5?this.work.observers.indexOf(r):null},n.prototype.coordinatesChangeWithOffset=function(e,t){var n=this.element,i=this.camera,r=n.offsetWidth,o=n.offsetHeight,s=2*t.x/r*i.fov/30,a=2*t.y/o*i.fov/30;return{longitude:et(e.longitude+s),latitude:Math.max(this.minLatitude,Math.min(this.maxLatitude,e.latitude+a))}},n.prototype.requestInteriaMovement=function(e,t){var n=this;if(!1!==this.interiaMovement){var i=this.coordinatesChangeWithOffset(this.camera.pose,e),r=i.longitude,o=i.latitude;this.updateCamera({longitude:r,latitude:o},t,!0);var s=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!s),s&&O((function(){n.requestInteriaMovement({x:.8*e.x,y:.8*e.y},t)}))}},n.prototype.onPanGesture=function(e){var t=this;if(!this.tweenCoordinates){this.interiaMovement=!1;var n=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},i=this.relativeClientPosition(e.center),r=this.camera.pose.latitude<Math.PI/6||i.y<0?-1:1,o=this.coordinatesChangeWithOffset(this.camera.pose,{x:n.x*r,y:n.y}),s=o.longitude,a=o.latitude,M=this.calculateCameraPosition({longitude:s,latitude:a},this.cameraDistance(),null,!0),u=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","pan",u,e.isFinal)||this.emit("wantsPanGesture",{longitude:s,latitude:a,fov:this.camera.pose.fov,offset:M.clone()},e.isFinal)))if(this.updateCamera({longitude:s,latitude:a,offset:M},!0,!0),this.emit("gesture","pan",u,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal)this.emit("wantsInteriaPan",this.camera.copyPose())||(this.interiaMovement=!0,C((function(n){var i=e.velocityX*n*r,o=e.velocityY*n,s=Math.sqrt(i*i+o*o);s>100&&(i=i/s*100,o=o/s*100),t.requestInteriaMovement({x:i,y:o},!0)})))}},n.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!this.tweenPosition){var t=this.relativeClientPosition(e.center),n=new u.Raycaster;n.setFromCamera(t,this.camera);var i=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",i,!0)||this.emit("wantsTapGesture",n,t))){this.emit("gesture","tap",i,!0),this.emit("tapGesture",n,t);var r;j(r=this.getForwardPanoIndexOrNot(n))||(this.emit("panoSelected",r),this.emit("wantsMoveToPano",r,{longitude:this.camera.pose.longitude,latitude:0},!0))}}},n.prototype.onPinchGesture=function(e){this.interiaMovement=!1;var t=this.camera,n=this.lastPinchPoint;if("pinchstart"===e.type)return delete this.lastPanPoint,void(this.lastPinchPoint=t.fov);"pinchend"===e.type&&(delete this.lastPanPoint,delete this.lastPinchPoint);var i="pinchend"===e.type;if(n){var r=n/e.scale,o=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",o,i)||this.emit("wantsPinchGesture",e.scale,r,i))return;this.updateCamera({fov:r},!0,!0),this.emit("gesture","pinch",o,i),this.emit("pinchGesture",e.scale,r,i)}},n.prototype.onMouseWheel=function(e){var t=this;this.interiaMovement=!1;var n=e.delta,i=this.minFov,r=this.maxFov,o=Math.max(i,Math.min(r,this.camera.fov-n)),s=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",s,!1)||this.emit("wantsMouseWheel",n,o,!1)||(this.updateCamera({fov:o},!0,!0),this.emit("gesture","mouseWheel",s,!1),this.emit("mouseWheel",n,o,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",s,!0)||t.emit("wantsMouseWheel",n,o,!0)||(t.emit("gesture","mouseWheel",s,!0),t.emit("mouseWheel",0,o,!0))}),200))},n}(yt),zt=function(e){function n(t){var i=n.parseArgs(t);return e.call(this,i)||this}return t.__extends(n,e),n.parseArgs=function(n){var i=[t.__assign(t.__assign({},n.initial[0]),{longitude:0,latitude:Math.PI/2}),n.initial[1],n.initial[2]],r=t.__assign(t.__assign({},n),{initial:i,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,r)},n.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},n.prototype.initAnimation=function(t,n,i){var r=this;return e.prototype.initAnimation.call(this,t,n,i).then((function(){var e,t;if(!r.destroyed){var i=null!==(t=null===(e=r.model.getMaterial())||void 0===e?void 0:e.perspToOrtho)&&void 0!==t?t:0;if(0===n)r.model.setMaterial({perspToOrtho:1}),r.needsRender=!0;else var o=Ke(250,Je.Linear.None).onUpdate((function(e){var t=e.progress;r.destroyed||(r.model.setMaterial({perspToOrtho:it(i,1,t)}),r.needsRender=!0)})).onComplete((function(){return o.destroy()}))}}))},n.prototype.resetModel=function(e,t){this.model=e,this.needsRender=!0;var n=this.calculateCameraPosition({longitude:this.defaultLongitude,latitude:this.defaultLatitude},this.cameraDistance(),null,!1);this.updateCamera({offset:n},t,!1)},n.prototype.getZoomOffsetFromFov=function(e,t,n){var i=new u.Vector3(0,-1,0),r=Math.tan(n/2*Math.PI/180),o=Math.tan(t.fov/2*Math.PI/180),s=(o-r)/o,a=new u.Raycaster;a.setFromCamera(e,t);var M=a.ray.direction,c=M.angleTo(i),l=this.cameraDistance(),d=l*Math.tan(c),N=M.clone().setLength(l*Math.cos(c)).projectOnPlane(i),p=N.length(),h=s/p*N.x*d,D=s/p*N.z*d;return new u.Vector3(h,0,D)},n.prototype.onPanGesture=function(e){if(!this.tweenCoordinates){var t=this.element,n=this.camera,i=n.fov,r=n.matrix,o=n.up,s=t.offsetHeight,a=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},M=this.camera.pose.offset.clone(),c=n.position.y*Math.tan(i/2*Math.PI/180);M.add(function(e,t){var n=new u.Vector3;return n.setFromMatrixColumn(t,0),n.multiplyScalar(-e),n}(2*a.x*c/s,r)),M.add(function(e,t,n){var i=new u.Vector3;return i.setFromMatrixColumn(n,0),i.crossVectors(t,i),i.multiplyScalar(e),i}(2*a.y*c/s,o,r));var l=this.model.bounding,d=l.getCenter(new u.Vector3),N=(l.max.x-l.min.x)/this.defaultFov*n.fov,p=(l.max.y,l.min.y,this.defaultFov,n.fov,(l.max.z-l.min.z)/this.defaultFov*n.fov);M.x=Math.max(d.x-N,Math.min(d.x+N,M.x)),M.z=Math.max(d.z-p,Math.min(d.z+p,M.z));var h=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",h,e.isFinal)||this.emit("wantsPanGesture",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:M},e.isFinal)||(this.updateCamera({offset:M},!0,!0),this.emit("gesture","pan",h,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y})}},n.prototype.onMouseWheel=function(e){var t=this,n=e.delta,i=e.clientX,r=e.clientY,o=this.camera,s=this.minFov,a=this.maxFov,M=Math.max(s,Math.min(a,this.camera.fov-n)),u=[{x:e.clientX,y:e.clientY}];if(!(this.emit("wantsGesture","mouseWheel",u,!1)||this.emit("wantsMouseWheel",n,M,!1))){var c=this.relativeClientPosition({x:i,y:r}),l=this.getZoomOffsetFromFov(c,o,M),d=this.camera.pose.offset.clone().add(l);this.updateCamera({offset:d,fov:M},!0,!0),this.emit("gesture","mouseWheel",u,!1),this.emit("mouseWheel",n,M,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",u,!0)||t.emit("wantsMouseWheel",n,M,!0)||(t.emit("gesture","mouseWheel",u,!0),t.emit("mouseWheel",0,M,!0))}),200)}},n.prototype.onPinchGesture=function(e){var t=this.camera,n=this.lastPinchPoint,i=e.scale,r=e.type,o=e.center,s=this.minFov,a=this.maxFov;if("pinchstart"===r)return delete this.lastPanPoint,void(this.lastPinchPoint=t.fov);"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchPoint);var M="pinchend"===r;if(n){var u=n/i,c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",c,M)||this.emit("wantsPinchGesture",i,u,M))return;u=Math.max(s,Math.min(a,u));var l=this.relativeClientPosition(o),d=this.getZoomOffsetFromFov(l,t,u),N=this.camera.pose.offset.clone().add(d);this.updateCamera({longitude:0,latitude:Math.PI/2,offset:N,fov:u},!0,!0),this.emit("gesture","pinch",c,M),this.emit("pinchGesture",i,u,M)}},n.prototype.__requestInteriaMovement=function(){},n}(Tt),jt=[];function ft(e){return e.onload=e.onerror=f,e.crossOrigin="",/^blob\:/.test(e.src)&&URL.revokeObjectURL(e.src),e.removeAttribute("src"),e}function vt(e){e instanceof u.Texture?e.dispose():(ft(e),0===jt.indexOf(e)&&jt.push(e))}function mt(e,t,n,i,r){if(void 0===e&&(e=""),void 0===t&&(t=f),void 0===n&&(n=f),void 0===i&&(i=f),void 0===r&&(r=f),/\.basis(\?|$)/.test(e)){var o=!1,s=!1;return Te.load(e,(function(e){t(e),i(1),!0===s&&e.dispose(),o=!0}),(function(e){i(e.loaded/e.total)}),(function(e){n(e.error),o=!0})),{abort:function(){o||r(),s=!0}}}var a=!1;return ne(e,{responseType:"blob"},(function(e,r){if(!a){if(e)return n(e),void(a=!0);var o=URL.createObjectURL(r),s=ft(jt.shift()||P());s.onload=function(){s.onload=s.onerror=f,a?vt(s):(O((function(){return t(s)})),i(1),a=!0)},s.onerror=function(){s.onload=s.onerror=f,a||(n(new Error("image load error.")),a=!0),vt(s)},s.src=o}}),i,(function(){a||(a=!1,r())}))}var wt=["right","left","up","down","front","back"];var It=function(e){function n(t){var n=e.call(this)||this;return n.images=[null,null,null,null,null,null],n.xhr=[null,null,null,null,null,null],n.aborted=!1,n.renderer=t,n}return t.__extends(n,e),n.prototype.load=function(e,t){var n=this,i=d.digest(e),r=f,o=f,s=f,a=f;"function"==typeof t?(r=t.bind(this,null),s=t.bind(this),a=t.bind(this)):(t.onLoad&&(r=t.onLoad),t.onProgress&&(o=t.onProgress),t.onError&&(s=t.onError),t.onAbort&&(a=t.onAbort)),this.abort(),this.disposeImages(),this.aborted=!1;for(var M=[0,0,0,0,0,0],u=function(t,i){M[i]=t,t=M.reduce((function(e,t){return e+t}),0)/M.length,o(t),n.emit("progress",t,e)},c=function(t){var o=function(e,t){var n=t.index,i=void 0===n?0:n,r=t.images,o=void 0===r?{}:r,s=t.imageOptions,a=void 0===s?{}:s,M=o[e],u=["cube",i,e].join("."),c=Te.isInitialized();return ie(M,Object.assign({key:u,basisLoaderInitialized:c},a))}(wt[t],e);l.xhr[t]=mt(o,(function(o){return function(t,o){u(1,o),n.images[o]=t,n.xhr[o]=null;for(var s=0,a=n.images;s<a.length;s++)if(!a[s])return;var M=n.toCubeTexture();M.hash=i,r(M),n.emit("load",M,e)}(o,t)}),(function(i){return function(t,i){n.aborted||(s(t),n.emit("error",t,e),n.xhr[i]=null,n.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null})),n.disposeImages())}(i,t)}),(function(e){return u(e,t)}),(function(){n.aborted||(n.aborted=!0,n.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null})),n.disposeImages(),a(new Error("image aborted")),n.emit("abort",e))}))},l=this,N=0;N<this.images.length;N++)c(N);this.emit("start",e)},n.prototype.abort=function(){this.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null}))},n.prototype.disposeImages=function(){for(var e=0;e<this.images.length;e++)if(this.images[e]){var t=this.images[e];t&&vt(t),this.images[e]=null}},n.prototype.toCubeTexture=function(){var e=new Y;e.generateMipmaps=!0;var n=e.dispose;return this.images[0]instanceof u.Texture?(e.format=this.images[0].format,e.encoding=this.images[0].encoding,e.minFilter=this.images[0].minFilter,e.magFilter=this.images[0].magFilter,e.isCompressedTexture=!0):e.minFilter=u.LinearFilter,this.images.forEach((function(t,n,i){e.images[n]=t,i[n]=null})),e.needsUpdate=!0,e.dispose=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return this.images.forEach((function(e){e&&vt(e)})),this.images=[],n.call.apply(n,t.__spreadArray([this],e))},e},n}(Re),xt=function(e){function n(t,n){var i=e.call(this)||this;i.disposed=!1,i.size=t.clone(),i.image=new ImageData(new Uint8ClampedArray([0,0,0,0]),1,1),i.generateMipmaps=!0,i.unpackAlignment=1,i.needsUpdate=!0,i.wrapS=u.ClampToEdgeWrapping,i.wrapT=u.ClampToEdgeWrapping,i.minFilter=u.NearestFilter,i.magFilter=u.NearestFilter,i.renderer=n;var r=i.gl=n.getContext(),o=i.utils=u.WebGLUtils(r,n.extensions,n.capabilities);n.initTexture(i);var s=n.properties.get(i),a=r.getParameter(r.TEXTURE_BINDING_2D);return r.bindTexture(r.TEXTURE_2D,s.__webglTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),r.texImage2D(r.TEXTURE_2D,0,o.convert(i.format),t.x,t.y,0,o.convert(i.format),o.convert(i.type),null),r.bindTexture(r.TEXTURE_2D,a),i.update(i.image,new u.Vector2),i}return t.__extends(n,e),n.prototype.update=function(e,t){if(!this.disposed){var n=this;n.size;var i=n.gl,r=n.utils,o=n.renderer.properties.get(this);if(!o.__webglTexture)throw new Error("UpdatableTexture never initialized");var s=i.getParameter(i.TEXTURE_BINDING_2D);i.bindTexture(i.TEXTURE_2D,o.__webglTexture),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.texSubImage2D(i.TEXTURE_2D,0,t.x,t.y,r.convert(this.format),r.convert(this.type),e),i.generateMipmap(i.TEXTURE_2D),i.bindTexture(i.TEXTURE_2D,s)}},n.prototype.dispose=function(){this.disposed=!0,e.prototype.dispose.call(this)},n}(u.Texture);var Lt=new re,Ot=P();Ot.crossOrigin="";var At=Promise.resolve(),Et=function(e){function n(t){var n=e.call(this)||this;n.texutre=new xt(new u.Vector2(2048,2048),t),n.mappings=[];for(var i,r,o=I(),s=0;s<16;s++){var a=(i=s,r=4,[Math.floor(i%r),Math.floor(i/r)]),M=a[0],c=a[1];n.mappings[s]={idle:!0,loaded:!0,resource:"",timestamp:o,clip:new u.Vector4(0,0,0,0),drawAt:new u.Vector4(M/4,c/4,1/4,1/4)}}return n}return t.__extends(n,e),n.prototype.requestResource=function(e){var t=this;At=At.then((function(){return new Promise((function(n){var i=function(){/^blob\:/.test(Ot.src)&&URL.revokeObjectURL(Ot.src),Ot.removeAttribute("src"),n()};Lt.loadToImage(Ot,e,(function(){if(512!==Ot.width||512!==Ot.height)t.emit("error",new Error("tile image size must be 512 x 512."));else{var n=t.getMaddpingByResource(e);if(n&&!0!==n.loaded){n.loaded=!0;var r=new u.Vector2(2048*n.drawAt.x,2048*n.drawAt.y);t.texutre.update(Ot,r),t.emit("update",t.getVisibleMappings())}}i()}),(function(){}),i)}))}))},n.prototype.getMaddpingByResource=function(e){return this.mappings.filter((function(t){return e===t.resource}))[0]},n.prototype.getIdleMapping=function(){return this.mappings.filter((function(e){return e.idle})).sort((function(e,t){return e.timestamp-t.timestamp}))[0]},n.prototype.getHash=function(){return d.digest(this.getVisibleMappings().map((function(e){return e.map((function(e){return e.toArray()}))})))},n.prototype.cleanTiles=function(){for(var e=this.getHash(),t=0,n=this.mappings;t<n.length;t++){n[t].idle=!0}e!==this.getHash&&this.emit("update",this.getVisibleMappings())},n.prototype.loadTiles=function(e){var t=this.getHash(),n=Math.pow(4,2),i=I();e.length>n&&((e=e.slice()).length=n);for(var r=0,o=this.mappings;r<o.length;r++){(N=o[r]).idle=!0}for(var s=[],a=0,M=e;a<M.length;a++){var u=ie((d=M[a]).resource);(N=this.getMaddpingByResource(u))?(N.idle=!1,N.timestamp=i):s.push(d)}for(var c=0,l=s;c<l.length;c++){var d,N;u=ie((d=l[c]).resource);(N=this.getIdleMapping()).idle=!1,N.resource=u,N.clip=d.clip,N.loaded=!1,N.timestamp=i,this.requestResource(u)}t!==this.getHash&&this.emit("update",this.getVisibleMappings())},n.prototype.getVisibleMappings=function(){return this.mappings.map((function(e){var t=!1===e.idle&&!0===e.loaded?e.drawAt.clone():new u.Vector4(0,0,0,0);return[e.clip.clone(),t.clone()]}))},n.prototype.dispose=function(){this.emit("dispose"),this.mappings.length=0,this.texutre.dispose()},n}(Re);var Ct=function(e){function n(){var t=e.call(this)||this,n=new u.RingBufferGeometry(.04,.08,32),i=new u.MeshBasicMaterial({color:1245179,opacity:.8,side:u.DoubleSide,transparent:!0});return t.ringMesh=new u.Mesh(n,i),t.ringMesh.renderOrder=10,t.add(t.ringMesh),t}return t.__extends(n,e),n.prototype.dispose=function(){this.remove(this.ringMesh),this.ringMesh.geometry.dispose(),Array.isArray(this.ringMesh.material)?this.ringMesh.material.forEach((function(e){return e.dispose()})):this.ringMesh.material.dispose()},n}(u.Object3D);function kt(){return new Ct}var Ut=function(e){function n(t){var i=this,r=n.parseArgs(t);return(i=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,i.defaultLatitude=r.defaultLongitude,i.defaultFov=r.defaultFov,i.maxFov=r.maxFov,i.minFov=r.minFov,i.maxLatitude=r.maxLatitude,i.minLatitude=r.minLatitude,i.moveSpeed=r.moveSpeed,i.intersectMeshCreator=r.intersectMeshCreator,i.interiaMovement=!1,i.intersectMesh=i.intersectMeshCreator(),i.intersectMesh.name="intersect",i.intersectMesh.visible=!1,i.helper.add(i.intersectMesh),i}return t.__extends(n,e),n.parseArgs=function(n){var i,r,o,s,a,M,u,c,l,d=e.parseArgs.call(this,n);return t.__assign(t.__assign({},d),{defaultLongitude:null!==(i=n.defaultLongitude)&&void 0!==i?i:0,defaultLatitude:null!==(r=n.defaultLongitude)&&void 0!==r?r:0,defaultFov:null!==(o=n.defaultFov)&&void 0!==o?o:80,maxFov:null!==(s=n.maxFov)&&void 0!==s?s:120,minFov:null!==(a=n.minFov)&&void 0!==a?a:40,maxLatitude:null!==(M=n.maxLatitude)&&void 0!==M?M:+Math.PI/2,minLatitude:null!==(u=n.minLatitude)&&void 0!==u?u:-Math.PI/2,moveSpeed:null!==(c=n.moveSpeed)&&void 0!==c?c:3.2,intersectMeshCreator:null!==(l=n.intersectMeshCreator)&&void 0!==l?l:kt})},n.initAnimationEndPose=function(e){var t,n,i,r=this.parseArgs(e),o=e.initial[0];return{longitude:null!==(t=o.longitude)&&void 0!==t?t:r.defaultLongitude,latitude:null!==(n=o.latitude)&&void 0!==n?n:r.defaultLatitude,fov:null!==(i=o.fov)&&void 0!==i?i:r.defaultFov,offset:r.work.observers[r.panoIndex].position.clone()}},n.prototype.destroy=function(){e.prototype.destroy.call(this),this.interiaMovement=!1,this.hideIntersectMesh(),this.intersectMesh&&(this.helper.remove(this.intersectMesh),this.intersectMesh.dispose())},n.prototype.updateCamera=function(e,t,n){var i,r,o;void 0===e&&(e={});var s=this,a=s.minFov,M=s.maxFov,u=s.maxLatitude,c=s.minLatitude,l=null!==(i=e.longitude)&&void 0!==i?i:this.camera.pose.longitude,d=null!==(r=e.latitude)&&void 0!==r?r:this.camera.pose.latitude,N=void 0===e.fov||this.emit("wantsChangeCameraFov",e.fov)?this.camera.pose.fov:e.fov,p=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset;n&&(d=Math.max(c,Math.min(u,d)),N=Math.max(a,Math.min(M,N)));var h=l!==this.camera.pose.longitude||d!==this.camera.pose.latitude,D=N!==this.camera.pose.fov,g=!p.equals(this.camera.pose.offset);this.camera.setFromPose({longitude:l,latitude:d,fov:N,offset:p}),D&&this.emit("cameraFovUpdate",this.camera.pose.fov,t),h&&this.emit("cameraDirectionUpdate",{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},t),g&&this.emit("cameraPositionUpdate",this.camera.pose.offset.clone(),t),(D||h||g)&&this.emit("cameraUpdate",this.camera.copyPose(),t),this.needsRender=!0,ce()},n.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 Math.floor(Math.max(Math.min(t/this.moveSpeed*1e3,1500),500))}},n.prototype.initAnimation=function(e,t,n){var i,r,o,s=this;if(this.destroyed)return Promise.resolve();var a=null!==(i=e.longitude)&&void 0!==i?i:this.defaultLongitude,M=null!==(r=e.latitude)&&void 0!==r?r:this.defaultLatitude,u=null!==(o=e.fov)&&void 0!==o?o:this.defaultFov;return new Promise((function(e){s.moveToPano(s.currentPanoIndex,{longitude:a,latitude:M,fov:u,limit:!1,duration:t,moveStartCallback:function(e,t){s.preventPanGesture=!0,s.preventTapGesture=!0,s.emit("initAnimationWillStart",e,t,n)},moveEndCallback:function(t,i){s.preventPanGesture=!1,s.preventTapGesture=!1,e(),s.emit("initAnimationEnded",t,i,n)},moveCancelCallback:function(){s.preventPanGesture=!1,s.preventTapGesture=!1,e(),s.emit("initAnimationEnded",s.currentPanoIndex,s.camera.copyPose(),n)}},n)}))},n.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},n.prototype.coordinatesChangeWithOffset=function(e,t){var n=2*t.x/this.element.offsetWidth*this.camera.fov/95*this.camera.aspect,i=-2*t.y/this.element.offsetHeight*this.camera.fov/95;return{longitude:e.longitude+n,latitude:e.latitude+i}},n.prototype.requestInteriaMovement=function(e,t){var n=this;if(!1!==this.interiaMovement){var i=this.coordinatesChangeWithOffset(this.camera.pose,e),r=i.longitude,o=i.latitude;this.updateCamera({longitude:r,latitude:o},t,!0);var s=Math.abs(e.x)>1||Math.abs(e.y)>1;this.emit("interiaPan",this.camera.copyPose(),!s),s?O((function(){n.requestInteriaMovement({x:.9*e.x,y:.9*e.y*.7},t)})):this.interiaMovement=!1}},n.prototype.onPanGesture=function(e){var t=this;this.interiaMovement=!1,this.hideIntersectMesh();var n=this.lastPanPoint&&this.lastPanPoint.pointerLength===e.pointers.length?{x:e.center.x-this.lastPanPoint.x,y:e.center.y-this.lastPanPoint.y}:{x:0,y:0},i=this.coordinatesChangeWithOffset(this.camera.pose,n),r=i.longitude,o=i.latitude;Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(o=this.camera.pose.latitude);var s=e.pointers.map((function(e){return{x:e.x,y:e.y}}));this.emit("wantsGesture","pan",s,e.isFinal)||this.emit("wantsPanGesture",this.camera.copyPose(),e.isFinal)||(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.updateCamera({longitude:r,latitude:o},!0,!0),this.emit("gesture","pan",s,e.isFinal),this.emit("panGesture",this.camera.copyPose(),e.isFinal),this.lastPanPoint=e.isFinal?void 0:{pointerLength:e.pointers.length,x:e.center.x,y:e.center.y},e.isFinal&&(this.emit("wantsInteriaPan",this.camera.copyPose())||C((function(n){t.interiaMovement=!0;var i=e.velocityX*n,r=e.velocityY*n,o=Math.sqrt(i*i+r*r);o>100&&(i=i/o*100,r=r/o*100),Math.abs(r/i)<Math.tan(20/180*Math.PI)&&(r=0),t.requestInteriaMovement({x:i,y:r},!0)}))))},n.prototype.onPinchGesture=function(e){this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var t=this.camera,n=this.lastPinchFov,i=e.scale,r=e.type;if("pinchstart"===r)return this.lastPinchFov=t.fov,void delete this.lastPanPoint;"pinchend"===r&&(delete this.lastPanPoint,delete this.lastPinchFov);var o="pinchend"===r;if(n){var s=n/i,a=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(this.emit("wantsGesture","pinch",a,o)||this.emit("wantsPinchGesture",i,s,o))return;this.updateCamera({fov:s},!0,!0),this.emit("gesture","pinch",a,o),this.emit("pinchGesture",i,s,o)}},n.prototype.onMouseWheel=function(e){var t=this;this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.interiaMovement=!1;var n=e.delta,i=this.minFov,r=this.maxFov,o=Math.max(i,Math.min(r,this.camera.fov-n)),s=[{x:e.clientX,y:e.clientY}];this.emit("wantsGesture","mouseWheel",s,!1)||this.emit("wantsMouseWheel",n,o,!1)||(this.updateCamera({fov:o},!0,!0),this.emit("gesture","mouseWheel",s,!1),this.emit("mouseWheel",n,o,!1),clearTimeout(this.onMouseWheelFinalInterval),this.onMouseWheelFinalInterval=window.setTimeout((function(){t.emit("wantsGesture","mouseWheel",s,!0)||t.emit("wantsMouseWheel",n,o,!0)||(t.emit("gesture","mouseWheel",s,!0),t.emit("mouseWheel",0,o,!0))}),200))},n.prototype.onMouseMove=function(e){var t=this,n=t.camera,i=t.model,r=t.intersectMesh,o=t.lastPanPoint;if(r&&!i.empty&&i.bvhs&&!0===i.bvhs.loaded&&!o){var s=this.relativeClientPosition({x:e.clientX,y:e.clientY}),a=new u.Raycaster;if(a.setFromCamera(s,n),this.emit("wantsShowIntersectionOnModel",a))return this.hideIntersectMesh(),void(this.needsRender=!0);var M=i.intersectRaycaster(a)[0];if(M&&M.face){var c=M.face.normal,l=c.clone().multiplyScalar(.05),d=M.point.clone().add(l);r.position.copy(d);var N=d.clone().add(l);if(r.lookAt(N),Math.abs(c.y)>.99){var p=n.pose.offset.clone().sub(d);r.rotation.z=-Math.atan2(p.z,p.x)}r.visible=!0,this.emit("intersectionOnModelUpdate",M,r),this.needsRender=!0}else this.hideIntersectMesh(),this.needsRender=!0;this.lastMouseMoveEvent={clientX:e.clientX,clientY:e.clientY}}},n.prototype.onMouseOut=function(){this.intersectMesh&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},n}(yt),St=P(),bt=new u.Texture(St);St.onload=function(){return bt.needsUpdate=!0},St.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAR9JREFUOBF10kFOAzEMBdCZFhCbrrgAN+NqHIULsWKDKO3gF+VHoZpa+rXjfH87nq7btr0ty3KZ8FsxnHeQPL748lA/x0Jsq+AwYe0X8nDtGA33BEJUHIEKW/EorHOLI7BHNlkEbju38YkQAIRZxFkHz2HOirKDxNcIzG+fu/6oLiNmqc5ZrlwTeKyAgJF14tMZmSn87pBrxeX/CRABgk/dl1s+C18dio2Pp9nmCQru2UtdvN+7lI9AFsgb3zNMcSp8FF4LYs3UhLfOAvkDJffci8q1J/ByRLKnQ8gUJUFOd2SeZYliCxwiyJCxCbhUGFKF4zPm61hiq7sVyJnPmATyR5IzLSNyDNEFRCDnkAmA8U2RfCsIefYhDeKOQLv7A+l1ZTyjymNxAAAAAElFTkSuQmCC";var Qt=new u.RingBufferGeometry(.06,.07,32).rotateX(-Math.PI/2),Yt=new u.MeshBasicMaterial({map:bt,transparent:!0});function Pt(){var e=document.createElement("canvas"),t=512,n=256,i=190;e.setAttribute("width",String(t)),e.setAttribute("height",String(t));var r=new u.Texture(e),o=e.getContext("2d");if(!o)throw Error("cannot create canvas context");var s=o.createRadialGradient(n,n,150,n,n,0);function a(){var e=Math.PI/12,t=2*Math.PI/3;o&&(o.beginPath(),o.arc(n,n,i,0*t,1*t-e),o.stroke(),o.beginPath(),o.arc(n,n,i,1*t,2*t-e),o.stroke(),o.beginPath(),o.arc(n,n,i,2*t,3*t-e),o.stroke())}function M(e){o&&(o.clearRect(0,0,t,t),o.lineWidth=20,-1!==e&&(o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, 1)",a(),o.globalCompositeOperation="source-in",o.beginPath(),o.arc(n,n,i,0,2*Math.PI*e),o.strokeStyle="rgba(255, 255, 255, 1)",o.stroke(),o.globalCompositeOperation="source-over",o.strokeStyle="rgba(255, 255, 255, "+(e?.5:1)+")",a()),o.beginPath(),o.arc(n,n,150,0,2*Math.PI),o.closePath(),o.fillStyle=s,o.fill(),o.fillStyle="rgba(255, 255, 255, 0.01)",o.fillRect(0,0,t,t),r.needsUpdate=!0)}return s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.15,"rgba(255, 255, 255, 1)"),s.addColorStop(.15,"rgba(255, 255, 255, 0.5)"),s.addColorStop(.4,"rgba(255, 255, 255, 0.0)"),s.addColorStop(1,"rgba(255, 255, 255, 0.0)"),M(0),Object.assign(r,{draw:M,retain:!1,pool:!1})}var _t=[];var Bt=Pt();Bt.draw(0);var Rt=Pt();Rt.draw(1);var Vt=Pt();Vt.draw(-1);var Ft=new u.CircleBufferGeometry(.12,32).rotateX(-Math.PI/2);function qt(){return new u.Mesh(Ft,new u.MeshBasicMaterial({map:Bt,transparent:!0}))}var Ht=function(e){function n(){var t=e.call(this)||this;return t.needsRender=!0,t.loading=!1,t.disabled=!1,t.centerMesh=qt(),t.centerMesh.position.y+=.01,t.add(t.centerMesh),t.loadingMesh=new u.Mesh(Qt,Yt),t.loadingMesh.position.y+=.011,t}return t.__extends(n,e),n.prototype.setLoading=function(e){var t=this;this.loading=e,this.stopInterval&&this.stopInterval(),e?(this.add(this.loadingMesh),this.stopInterval=A((function(){t.loadingMesh.rotateOnAxis(new u.Vector3(0,1,0),.1),t.needsRender=!0}))):this.remove(this.loadingMesh),this.needsRender=!0},n.prototype.setDisabled=function(e){function t(t){var n=t.map;!0===n.pool&&(n.retain=!1),t.map=e?Vt:Bt}this.disabled=e,Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){t(e)})):t(this.centerMesh.material),this.needsRender=!0},n.prototype.setProgress=function(e){function t(e,t){var n=e.map;0===t||1===t?(!0===n.pool&&(n.retain=!1),0===t&&(e.map=Bt),1===t&&(e.map=Rt)):(!0!==n.pool&&(e.map=function(){for(var e=0,t=_t;e<t.length;e++){var n=t[e];if(!1===n.retain)return n}var i=Pt();return i.pool=!0,i.retain=!0,_t.push(i),i}()),e.map.draw(t))}this.setLoading(!1),this.setDisabled(!1),e=Math.max(0,Math.min(1,e)),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(n){t(n,e)})):t(this.centerMesh.material,e),this.needsRender=!0},n.prototype.setOpacity=function(e){Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(t){t.opacity=e})):this.centerMesh.material.opacity=e,this.needsRender=!0},n.prototype.dispose=function(){this.setLoading(!1),this.remove(this.centerMesh),this.remove(this.loadingMesh),this.centerMesh.geometry.dispose(),Array.isArray(this.centerMesh.material)?this.centerMesh.material.forEach((function(e){e.dispose()})):this.centerMesh.material.dispose(),this.loadingMesh.geometry.dispose(),Array.isArray(this.loadingMesh.material)?this.loadingMesh.material.forEach((function(e){e.dispose()})):this.loadingMesh.material.dispose()},n}(u.Object3D);function Gt(){return new Ht}function Wt(e){var t=Math.abs(Math.cos(e.latitude));return new u.Vector3(-Math.sin(e.longitude)*t,-Math.sin(e.latitude),-Math.cos(e.longitude)*t)}var Zt=new u.OrthographicCamera(-1,1,1,-1,0,1),Jt=new u.BufferGeometry;Jt.setAttribute("position",new u.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),Jt.setAttribute("uv",new u.Float32BufferAttribute([0,2,0,0,2,0],2));var Xt=new u.Mesh(Jt),Kt=new u.Scene;Kt.add(Xt);for(var $t=function(){function e(e,t){var n;this.renderer=e,this.material=new u.ShaderMaterial({vertexShader:null!==(n=t.vertex)&&void 0!==n?n:"\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:{value:null}},t.uniforms)})}return e.prototype.render=function(e,t){var n=this.renderer.getRenderTarget(),i=Xt.material;this.material.uniforms.inputBuffer.value=e.texture,Xt.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Kt,Zt),this.renderer.setRenderTarget(n),Xt.material=i},e.prototype.dispose=function(){this.material.dispose()},e}(),en=function(){function e(e){this.renderer=e,this.material=new u.ShaderMaterial({vertexShader:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 inputValue;\n void main() {\n gl_FragColor = vec4(inputValue, 1.0);\n }\n ",uniforms:Object.assign({inputValue:{value:new u.Vector3}})})}return e.prototype.render=function(e,t){var n=this.renderer.getRenderTarget(),i=Xt.material;this.material.uniforms.inputValue.value.copy(e),Xt.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(Kt,Zt),this.renderer.setRenderTarget(n),Xt.material=i},e.prototype.dispose=function(){this.material.dispose()},e}(),tn=function(e){function n(t){return e.call(this,t,{fragment:"\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n gl_FragColor = texture2D(inputBuffer, vUv);\n }\n "})||this}return t.__extends(n,e),n}($t),nn=function(e){function n(t){return e.call(this,t,{fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n varying vec2 vUv;\n void main() {\n float scale = 0.25;\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 = linearToRelativeLuminance(rgb) - 0.5;\n luminance = luminance / 2.0 + 0.5;\n gl_FragColor = vec4(luminance, luminance, luminance, 1.0);\n }\n "})||this}return t.__extends(n,e),n}($t),rn=function(e){function n(t,n){return void 0===n&&(n=.002),e.call(this,t,{uniforms:{targetBuffer:{value:null},inputBuffer:{value:null},step:{value:n}},vertex:"\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragment:"\n uniform sampler2D targetBuffer;\n uniform sampler2D inputBuffer;\n uniform float step;\n void main() {\n float target = texture2D(targetBuffer, vec2(0.5, 0.5)).r;\n float current = texture2D(inputBuffer, vec2(0.5, 0.5)).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 t.__extends(n,e),Object.defineProperty(n.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(n.prototype,"step",{get:function(){return this.material.uniforms.step.value},set:function(e){this.material.uniforms.step.value=e},enumerable:!1,configurable:!0}),n}($t),on=function(e){function n(t){return e.call(this,t,{uniforms:{inputBuffer:{value:null},luminanceAdaptiveBUffer:{value:null}},fragment:"\n #include <common>\n uniform sampler2D inputBuffer;\n uniform sampler2D luminanceAdaptiveBUffer;\n varying vec2 vUv;\n\n vec3 hsv2rgb(vec3 c) {\n const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n }\n\n vec3 rgb2hsv(vec3 c) {\n const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);\n }\n\n void main() {\n vec3 rgb = texture2D(inputBuffer, vUv).rgb;\n float luminance = linearToRelativeLuminance(rgb);\n float delta = (texture2D(luminanceAdaptiveBUffer, vec2(0.5, 0.5)).r - 0.5);\n vec3 hsv = rgb2hsv(rgb);\n if (delta > 0.0) {\n hsv.z -= delta * (1.0 - luminance);\n } else {\n hsv.z -= delta * luminance;\n }\n gl_FragColor = vec4(hsv2rgb(hsv), 1.0);\n }\n\n "})||this}return t.__extends(n,e),Object.defineProperty(n.prototype,"luminanceAdaptiveBUffer",{get:function(){return this.material.uniforms.luminanceAdaptiveBUffer.value},set:function(e){this.material.uniforms.luminanceAdaptiveBUffer.value=e},enumerable:!1,configurable:!0}),n}($t),sn=function(){function e(e){this.enable=!0,this.renderer=e,this.valuePass=new en(this.renderer),this.copyPass=new tn(this.renderer),this.luminancePass=new nn(this.renderer),this.nextStepPass=new rn(this.renderer),this.luminanceAdaptivePass=new on(this.renderer)}return e.prototype.render=function(e){this.enable?(this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new u.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new u.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new u.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new u.WebGLRenderTarget(1,1,{encoding:this.renderer.outputEncoding}),this.valuePass.render(new u.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.render(e)):this.copyPass.render(e)},e.prototype.dispose=function(){var e,t,n;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(n=this.luminanceNextBuffer)||void 0===n||n.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},e}(),an=(new u.Matrix4).makeRotationAxis(new u.Vector3(0,1,0),Math.PI),Mn=new u.Vector2(16,8),un=[],cn=0;cn<Mn.x;cn++)for(var ln=0;ln<Mn.y;ln++){un[ln*Mn.x+cn]=[];var dn=Wt({longitude:2*Math.PI/Mn.x*(cn+.5),latitude:Math.PI/Mn.y*(ln+.5)-Math.PI/2});un[ln*Mn.x+cn].push(dn);for(var Nn=0;Nn<=8;Nn++)for(var pn=0;pn<=8;pn++){var hn=Wt({longitude:2*Math.PI/Mn.x*(cn+Nn/8),latitude:Math.PI/Mn.y*(ln+pn/8)-Math.PI/2});un[ln*Mn.x+cn].push(hn)}}var Dn=new u.MeshDistanceMaterial({nearDistance:0,farDistance:10}),gn=new u.Scene;gn.overrideMaterial=Dn;var yn=function(e){function n(t){var i=this,r=n.parseArgs(t);(i=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,i.panoTapTriggerRadius=r.panoTapTriggerRadius,i.panoCircleMeshCreator=r.panoCircleMeshCreator;var o=i.model.getMaterial()||{},s=o.pano0Map,a=o.pano1Map;return a&&a!==s&&(i.model.setMaterial({pano1Map:s}),a.dispose()),i.boundingMesh=i.generateBoundingMesh(),i.boundingMesh.setMaterial(i.model.getMaterial()||{}),i.boundingMesh.name="bounding",i.boundingMesh.visible=!1,i.scene.add(i.boundingMesh),i.panoCircleMeshes=[],i.updatePanoCircleMeshes(),i.model.loaded||i.panoCircleMeshes.forEach((function(e){return e.visible=!1})),i.depthCamera=new u.CubeCamera(.01,10,new u.WebGLCubeRenderTarget(64)),r.enableLuminanceAdaptiveEffect&&(i.luminanceAdaptiveEffect=new sn(i.renderer),i.luminanceAdaptiveEffect.enable=!1,i.postProcessing=function(e){var t;return null===(t=i.luminanceAdaptiveEffect)||void 0===t?void 0:t.render(e)}),i.cubeTextureLoader=new It(i.renderer),i.cubeTextureLoader.on("start",(function(e){var t,n=e.index;null===(t=i.panoCircleMeshes[n])||void 0===t||t.setProgress(0),i.emit("textureStartLoad",n,i.work.observers[n])})),i.cubeTextureLoader.on("progress",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(e),i.emit("textureLoading",e,r,i.work.observers[r])})),i.cubeTextureLoader.on("abort",(function(e){var t,n=e.index;null===(t=i.panoCircleMeshes[n])||void 0===t||t.setProgress(0),i.emit("textureAbort",n,i.work.observers[n])})),i.cubeTextureLoader.on("load",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(1),i.emit("textureLoaded",r,i.work.observers[r])})),i.cubeTextureLoader.on("error",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(0),i.emit("textureError",e,r,i.work.observers[r]),i.emit("error",e)})),i.once("initAnimationWillStart",(function(){(new u.Box3).expandByObject(i.boundingMesh).containsPoint(i.camera.position)&&(i.boundingMesh.visible=!0),i.luminanceAdaptiveEffect&&(i.luminanceAdaptiveEffect.enable=!0)})),i.once("panoArrived",(function(){i.boundingMesh.visible=!0})),i.on("panoWillArrive",(function(){return i.ready=!1})),i.on("moveToPanoCanceled",(function(){return i.ready=!0})),i.on("panoArrived",(function(){return i.ready=!0})),i}return t.__extends(n,e),n.parseArgs=function(n){var i,r,o,s,a=e.parseArgs.call(this,n);return t.__assign(t.__assign({},a),{enableLuminanceAdaptiveEffect:null!==(i=n.enableLuminanceAdaptiveEffect)&&void 0!==i&&i,maxAccessibleDistance:null!==(r=n.maxAccessibleDistance)&&void 0!==r?r:5,panoTapTriggerRadius:null!==(o=n.panoTapTriggerRadius)&&void 0!==o?o:1,panoCircleMeshCreator:null!==(s=n.panoCircleMeshCreator)&&void 0!==s?s:Gt})},n.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},n.prototype.getCurrentTileIndicesInCamera=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(new u.Matrix4).compose(e.position,e.quaternion,new u.Vector3(-1,1,1)),n=this.camera.getWorldDirection(new u.Vector3),i=(new u.Matrix4).multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),r=(new u.Frustum).setFromProjectionMatrix(i),o=[],s=0;s<un.length;s++)for(var a=0,M=un[s];a<M.length;a++){var c=M[a];if(r.containsPoint(c.clone().applyMatrix4(t))){o.push(s);break}}return o.sort((function(e,t){return un[e][0].angleTo(n)-un[t][0].angleTo(n)})),o},n.prototype.tilingPanoIfNeeds=function(){var e,t=this,n=this.camera.pose.fov<=70,i=this.work.observers[this.currentPanoIndex],r=i.images.tiles;if(n&&r&&i.position.equals(this.camera.pose.offset)){this.tileTextureLoader||(this.tileTextureLoader=new Et(this.renderer),this.tileTextureLoader.on("update",(function(e){t.setModelAndBoundingMaterial({panoTileMap:t.tileTextureLoader.texutre,panoTileMappings:e}),t.needsRender=!0})));for(var o=this.getCurrentTileIndicesInCamera(),s=[],a=0;a<Mn.x*Mn.y;a++)if(-1!==o.indexOf(a)){var M=Math.floor(a%Mn.x),c=Math.floor(a/Mn.x),l=new u.Vector4(M/Mn.x,c/Mn.y,1/Mn.x,1/Mn.y),d=r+"/row-"+(c+1)+"-column-"+(M+1)+".jpg";s.push({resource:d,clip:l})}this.tileTextureLoader.loadTiles(s)}else null===(e=this.tileTextureLoader)||void 0===e||e.cleanTiles()},n.prototype.updateWork=function(e,t,n,i){var r=this;this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex;var o={},s=!0;return this.boundingMesh&&(o=this.boundingMesh.getMaterial()||{},s=this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(!0),this.boundingMesh.name="bounding",this.boundingMesh.visible=s,this.boundingMesh.setMaterial(o),this.scene.add(this.boundingMesh),this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{effect:"fade",duration:n,longitude:t.longitude,latitude:t.latitude,fov:t.fov,moveStartCallback:function(){return r.updatePanoCircleMeshes(!1)}},i),!0},n.prototype.updatePanoCircleMeshes=function(e){var t=this;void 0===e&&(e=!0);var n=[];this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){e.loading&&n.push(e.panoIndex),t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0);var i=new u.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,o){var s=t.panoCircleMeshCreator();if(s.position.copy(r.standingPosition),e&&t.model.loaded){var a=s.position.clone().add(new u.Vector3(0,1,0)),M=new u.Raycaster(a,i,0,1),c=t.model.intersectRaycaster(M)[0];c&&c.point.distanceTo(s.position)>.1&&(s.position.copy(c.point.clone()),s.needsRender=!0)}return s.name="panoCircle_"+o,s.panoIndex=o,t.helper.add(s),s.needsRender=!0,!1===r.active&&(s.setDisabled(!0),n.indexOf(o)>=0&&(s.setDisabled(!1),s.setLoading(!0))),s}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(e){var n=t.work.observers[e];return n.loadable||n.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var o=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(o);e.setOpacity(Math.min(1.5/t,1))}))},n.prototype.destroy=function(){var t,n,i,r,o=this;e.prototype.destroy.call(this),null===(t=this.luminanceAdaptiveEffect)||void 0===t||t.dispose(),this.cubeTextureLoader.off(),null===(n=this.tileTextureLoader)||void 0===n||n.dispose(),delete this.pendingLoadTextureHashAndCallback,this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){o.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0),this.interiaMovement=!1;var s=this.videoTexture.image;s.pause(),s.oncanplay=function(){},s.ontimeupdate=function(){};var a={pano0DepthMap:null,panoVideoMap:null,panoVideoSize:new u.Vector2,panoVideoMatrix:new u.Matrix4,panoVideoAlpha:0};this.setModelAndBoundingMaterial(a),null===(i=this.depthCamera)||void 0===i||i.renderTarget.texture.dispose(),null===(r=this.depthCamera)||void 0===r||r.renderTarget.dispose(),delete this.depthCamera},n.prototype.render=function(t){this.work.observers[this.currentPanoIndex].video&&(this.needsRender=!0),e.prototype.render.call(this,t)},n.prototype.generateBoundingMesh=function(e){void 0===e&&(e=!1);var t=this.model.bounding.clone();return this.work.observers.forEach((function(e){t.expandByPoint(e.standingPosition),t.expandByPoint((new u.Vector3).fromArray([e.position.x,2*e.position.y-e.standingPosition.y,e.position.z]))})),e&&t.expandByPoint(this.camera.pose.offset),W(t,new u.Vector3(1,0,1))},n.prototype.resetModel=function(e,t){var n=this;this.model=e;var i={};this.boundingMesh&&(i=this.boundingMesh.getMaterial()||{},this.boundingMesh.visible,this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.boundingMesh=this.generateBoundingMesh(),this.boundingMesh.visible=!0,this.boundingMesh.name="bounding",this.boundingMesh.setMaterial(i),this.scene.add(this.boundingMesh),this.needsRender=!0,le((function(){n.updatePanoCircleMeshes(),n.updateCamera({},t,!0),n.needsRender=!0}))},n.prototype.moveToPano=function(e,t,n){var i=this;this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},o=d.digest(r),s=function(r,o){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),i.emit("panoLoadError",r,e),void i.emit("moveToPanoCanceled",e);var s=o;i.destroyed?s.dispose():(i.emit("panoLoaded",e),O((function(){return i.doMoveToPano(e,s,t,n)})))},a=this.pendingLoadTextureHashAndCallback||[],M=a[0],u=a[1];if(o!==M){if(delete this.pendingLoadTextureHashAndCallback,u&&u(new Error("texture aborted")),this.emit("moveToPano",e,n),this.emit("panoWillLoad",e),!r.images)return void s(new Error("pano images were not existed"));var c=this.getModelAndBoundingMaterial()||{},l=c.pano0Map,N=c.pano1Map,p=void 0;if(l&&l.hash===o?p=l:N&&N.hash===o&&(p=N),p)return void s(null,p);this.pendingLoadTextureHashAndCallback=[o,s],this.cubeTextureLoader.load(r,(function(e,t){var n=i.pendingLoadTextureHashAndCallback||[],r=n[0],s=n[1];o===r&&s?(s(e,t),delete i.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},n.prototype.updateCamera=function(t,n,i){var r=this;void 0===t&&(t={}),e.prototype.updateCamera.call(this,t,n,i),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1.5/t,1))}));var o=this.getForwardPanoIndexOrNot();null!==o&&this.panoCircleMeshes[o].setOpacity(1),this.needsRender=!0,ce(),this.tilingPanoIfNeeds()},n.prototype.canNotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,n=.98*t,i=function(t){var n=t.fov;e.updateCamera({fov:n},!0,!0)};this.tweenCoordinates=Xe({fov:t},{fov:n},200).onUpdate(i).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=Xe({fov:n},{fov:t},200).onUpdate(i).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},n.prototype.getModelAndBoundingMaterial=function(){for(var e=0,t=[this.model,this.boundingMesh];e<t.length;e++){return t[e].getMaterial()}return null},n.prototype.setModelAndBoundingMaterial=function(e){for(var t=0,n=[this.model,this.boundingMesh];t<n.length;t++){n[t].setMaterial(e)}},n.prototype.doMoveToPano=function(e,t,n,i){var r,o,s,a,M,c,l,d,N,p,h,D=this;void 0===n&&(n={});var g=n.effect,y=void 0===g?"fly":g,T=n.limit,z=void 0===T||T,j=n.easing,f=void 0===j?Je.Quadratic.InOut:j,v=this.currentPanoIndex,m=this.work.observers[e],w=this.work.observers[v].accessibleNodes.indexOf(e)>=0,I=m.video,x=m.visibleNodes;x=x.filter((function(e){var t=D.work.observers[e];return t.loadable||t.active}));var L=this.calculateMovingDuration(n.duration,this.camera.pose.offset.distanceTo(m.standingPosition)),A=this.camera.pose.offset.clone(),E=null!==(o=null===(r=this.getModelAndBoundingMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,C=null!==(a=null===(s=this.model.getMaterial())||void 0===s?void 0:s.perspToOrtho)&&void 0!==a?a:0,k=this.camera.pose.longitude,U=this.camera.pose.latitude,S=this.camera.pose.fov,b=m.position,Q=null!==(c=null===(M=this.getModelAndBoundingMaterial())||void 0===M?void 0:M.pano0Matrix)&&void 0!==c?c:new u.Matrix4,Y=(new u.Matrix4).compose(m.position,m.quaternion,new u.Vector3(-1,1,1)),P=null!==(l=n.longitude)&&void 0!==l?l:k,_=null!==(d=n.latitude)&&void 0!==d?d:U,B=null!==(N=n.fov)&&void 0!==N?N:S,R={fov:B,longitude:P,latitude:_,offset:b.clone()};this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),n.moveStartCallback&&n.moveStartCallback(e,R),this.emit("panoWillArrive",e,R,i),this.needsRender=!0,w&&(gn.add(this.model),Dn.referencePosition.copy(A),null===(p=this.depthCamera)||void 0===p||p.position.copy(A),null===(h=this.depthCamera)||void 0===h||h.update(this.renderer,gn),this.scene.add(this.model),this.scene.children.unshift(this.scene.children.pop()));var V=function(){var r=D.getModelAndBoundingMaterial()||{},o=r.pano0Map,s=r.pano1Map;o&&o!==s&&o!==t&&o.dispose();var a={modelAlpha:0,perspToOrtho:0,pano0Matrix:Y,pano0Map:t,pano0DepthMap:D.depthCamera?D.depthCamera.renderTarget.texture:null,pano1Matrix:Y,pano1Map:t,progress:0};if(I&&Object.keys(I).length>0){var M=D.videoTexture.image;M.oncanplay=function(){M.oncanplay=function(){},M.currentTime=0,M.play(),D.setModelAndBoundingMaterial({panoVideoAlpha:0,panoVideoMap:D.videoTexture,panoVideoSize:I.size,panoVideoMatrix:an.clone().multiply(Y).multiply(I.matrix)})},M.src=I.source,M.ontimeupdate=function(){if(M.currentTime>.5&&M.src===(null==I?void 0:I.source)){M.ontimeupdate=function(){};var e=Ke(230,f).onUpdate((function(e){var t=e.progress;return D.setModelAndBoundingMaterial({panoVideoAlpha:t})})).onComplete((function(){return e.destroy()}))}}}D.setModelAndBoundingMaterial(a),D.panoCircleMeshes.forEach((function(e){e.visible=x.indexOf(e.panoIndex)>=0})),D.updateCamera({offset:b},i,z),D.panoCircleMeshes[e]&&D.panoCircleMeshes[e].setProgress(0),n.moveEndCallback&&n.moveEndCallback(e,D.camera.copyPose()),D.currentPanoIndex=e,D.preventTapGesture=!1,O((function(){D.emit("panoArrived",e,D.camera.copyPose(),i)})),D.needsRender=!0};if(this.preventTapGesture=!0,L){var F=this.videoTexture.image;F.pause(),F.removeAttribute("src"),F.oncanplay=function(){},F.ontimeupdate=function(){},this.videoTexture.needsUpdate=!0;var q=this.getModelAndBoundingMaterial()||{},H=q.pano0Map,G=q.pano1Map;G&&G!==H&&G!==t&&G.dispose();var W={pano1Matrix:Y,pano1Map:t,pano0DepthMap:w&&this.depthCamera?this.depthCamera.renderTarget.texture:null,panoVideoMap:null,panoVideoSize:new u.Vector2,panoVideoMatrix:new u.Matrix4,panoVideoAlpha:0,useBlackTransition:"instant"===y};if("fade"===y){var Z=Q.clone();Z.setPosition(b),W.pano0Matrix=Z,A.copy(b),this.updateCamera({offset:b},i,z)}this.setModelAndBoundingMaterial(W),"fly"!==y&&this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),this.renderer.compile(this.scene,this.camera),this.tweenPosition=Ke(L,f).onUpdate((function(t){var n=t.progress;D.setModelAndBoundingMaterial({progress:n,modelAlpha:it(E,0,n),perspToOrtho:it(C,0,Math.min(5*n,1))});var r=new u.Vector3(it(A.x,b.x,n),it(A.y,b.y,n),it(A.z,b.z,n));D.updateCamera({offset:r},i,z),n>.9&&(D.preventTapGesture=!1),D.emit("movingToPano",e,v,n),"fly"===y?i&&D.lastMouseMoveEvent&&D.onMouseMove(D.lastMouseMoveEvent):D.hideIntersectMesh(),D.needsRender=!0})).onComplete((function(){D.tweenPosition&&(D.tweenPosition.completed=!0,D.tweenPosition.destroy()),delete D.tweenPosition,V()})).onCancel((function(){n.moveCancelCallback&&n.moveCancelCallback()}))}else V();if(k!==P||U!==_||S!==B){var J=function(e){var t=e.progress,n=rt(k,P,t),r=it(U,_,t),o=it(S,B,t);D.updateCamera({longitude:n,latitude:r,fov:o},i,z)},X=function(){return J({progress:1})};L>0?this.tweenCoordinates=Ke(L,f).onUpdate(J).onComplete((function(){D.tweenCoordinates&&(D.tweenCoordinates.destroy(),delete D.tweenCoordinates),X()})):X()}},n.prototype.getForwardPanoIndexOrNot=function(e){var t=this,n=this.camera,i=this.currentPanoIndex,r=this.work.observers[i].accessibleNodes;r=r.filter((function(e){var n=t.work.observers[e];return n.loadable||n.active}));var o,s=n.getWorldDirection(new u.Vector3);o=e?e.ray.direction.clone():s.clone();var a=n.pose.offset.clone();if(o.y=a.y=0,0===o.length()||0===a.length())return null;for(var M=0,c=r.filter((function(e){var i=t.work.observers[e].standingPosition.clone().sub(n.pose.offset);return 0!==i.length()&&i.angleTo(s)<n.fov/2/180*Math.PI})).map((function(e){var n=t.work.observers[e].standingPosition.clone();return Object.assign(n,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(a)-t.distanceTo(a)}));M<c.length;M++){var l=c[M],d=l.clone().sub(a);if(0!==d.length()&&o.angleTo(d)<Math.PI/6)return l.panoIndex}return null},n.prototype.onTapGesture=function(e){var n=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var i=null,r=this.work.observers[this.currentPanoIndex],o=r.accessibleNodes.filter((function(e){return n.work.observers[e].position.distanceTo(n.camera.pose.offset)<n.maxAccessibleDistance})),s=this.relativeClientPosition(e.center),a=new u.Raycaster;a.setFromCamera(s,this.camera);var M=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",M,!0)||this.emit("wantsTapGesture",a,s))){this.emit("gesture","tap",M,!0),this.emit("tapGesture",a,s);var c=this.camera.getWorldDirection(new u.Vector3).setY(0).normalize(),l=this.model.intersectRaycaster(a)[0];if(l){var d=ut(o,(function(e){var t=n.work.observers[e].standingPosition.clone();return t.clone().sub(n.camera.pose.offset).setY(0).angleTo(c)>Math.PI/2?1/0:t.distanceTo(l.point)}),!0),N=d[0];d[1]<this.panoTapTriggerRadius&&(i=N)}if(j(i)&&(i=this.getForwardPanoIndexOrNot(a)),j(i))this.canNotMoveAnimation();else{var p=this.work.observers[i];if(this.emit("panoSelected",i),p.active){for(var h=Math.PI/6,D=Math.PI/12,g=p.position.clone().setY(0).sub(r.position.clone().setY(0)).normalize(),y=g.clone().applyAxisAngle(new u.Vector3(0,1,0),h),T=g.clone().applyAxisAngle(new u.Vector3(0,1,0),-h),z=[],f=[],v=[],m=0,w=p.accessibleNodes;m<w.length;m++){if((N=w[m])!==this.currentPanoIndex&&N!==i){var I=this.work.observers[N].position.clone().setY(0).sub(p.position.clone().setY(0));g.angleTo(I)<h?v.push(I):y.angleTo(I)<h?z.push(I):T.angleTo(I)<h&&f.push(I)}}var x=(v.length>0?v:t.__spreadArray(t.__spreadArray([],z),f)).slice().sort((function(e,t){return e.angleTo(g)-t.angleTo(g)}))[0],L={};x&&x.angleTo(c)>D&&(L.longitude=Math.atan2(-x.x,-x.z)),this.emit("wantsMoveToPano",i,L,!0)}else this.panoCircleMeshes[i]&&(this.panoCircleMeshes[i].setDisabled(!1),this.panoCircleMeshes[i].setLoading(!0))}}}},n}(Ut);function Tn(e,t){var n,i,r,o,s=new u.Vector3,a=new u.Vector3,M=null;"VRFrameData"in window&&(M=new window.VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){i=e,e.length>0?n=e[0]:t&&t(new Error("HMD not available"))})).catch((function(){console.warn("THREE.VREffect: Unable to get VR Displays")})),this.isPresenting=!1,this.scale=1;var c=this,l=e.getSize(new u.Vector2),d=!1,N=e.getPixelRatio();this.getVRDisplay=function(){return n},this.setVRDisplay=function(e){n=e},this.getVRDisplays=function(){return console.warn("THREE.VREffect: getVRDisplays() is being deprecated."),i},this.setSize=function(t,i,r){if(l=new u.Vector2(t,i),d=r,c.isPresenting){var o=n.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*o.renderWidth,o.renderHeight,!1)}else e.setPixelRatio(N),e.setSize(t,i,r)};var p=e.domElement,h=[0,0,.5,1],D=[.5,0,.5,1];function g(){var t=c.isPresenting;if(c.isPresenting=void 0!==n&&n.isPresenting,c.isPresenting){var i=n.getEyeParameters("left"),r=i.renderWidth,o=i.renderHeight;t||(N=e.getPixelRatio(),l=e.getSize(new u.Vector2),e.setPixelRatio(1),e.setSize(2*r,o,!1))}else t&&(e.setPixelRatio(N),e.setSize(l.width,l.height,d))}window.addEventListener("vrdisplaypresentchange",g,!1),this.setFullScreen=function(e){return new Promise((function(t,i){void 0!==n?c.isPresenting!==e?e?(n.requestPresent([{source:p}]),t()):(n.exitPresent(),t()):t():i(new Error("No VR hardware found."))}))},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==n?n.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==n?n.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==n&&c.isPresenting&&n.submitFrame()},this.autoSubmitFrame=!0;var y=new u.PerspectiveCamera;y.layers.enable(1);var T=new u.PerspectiveCamera;function z(e,t,n,i){var r=Math.PI/180;return function(e,t,n,i){n=void 0===n?.01:n,i=void 0===i?1e4:i;var r=(t=void 0===t||t)?-1:1,o=new u.Matrix4,s=o.elements,a=function(e){var t=2/(e.leftTan+e.rightTan),n=(e.leftTan-e.rightTan)*t*.5,i=2/(e.upTan+e.downTan);return{scale:[t,i],offset:[n,(e.upTan-e.downTan)*i*.5]}}(e);return s[0]=a.scale[0],s[1]=0,s[2]=a.offset[0]*r,s[3]=0,s[4]=0,s[5]=a.scale[1],s[6]=-a.offset[1]*r,s[7]=0,s[8]=0,s[9]=0,s[10]=i/(n-i)*-r,s[11]=i*n/(n-i),s[12]=0,s[13]=0,s[14]=r,s[15]=0,o.transpose(),o}({upTan:Math.tan(e.upDegrees*r),downTan:Math.tan(e.downDegrees*r),leftTan:Math.tan(e.leftDegrees*r),rightTan:Math.tan(e.rightDegrees*r)},t,n,i)}T.layers.enable(2),this.render=function(t,i){var l,d;if(n&&c.isPresenting){var N=t.autoUpdate;N&&(t.updateMatrixWorld(),t.autoUpdate=!1);var p=n.getEyeParameters("left"),g=n.getEyeParameters("right");s.fromArray(p.offset),a.fromArray(g.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var j,f,v=e.getSize(new u.Vector2),m=n.getLayers();if(m.length){var w=m[0];j=null!==w.leftBounds&&4===(null===(l=w.leftBounds)||void 0===l?void 0:l.length)?w.leftBounds:h,f=null!==w.rightBounds&&4===(null===(d=w.rightBounds)||void 0===d?void 0:d.length)?w.rightBounds:D}else j=h,f=D;r={x:Math.round(v.width*j[0]),y:Math.round(v.height*j[1]),width:Math.round(v.width*j[2]),height:Math.round(v.height*j[3])},o={x:Math.round(v.width*f[0]),y:Math.round(v.height*f[1]),width:Math.round(v.width*f[2]),height:Math.round(v.height*f[3])},e.setScissorTest(!0),e.autoClear&&e.clear(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorld.decompose(y.position,y.quaternion,y.scale),i.matrixWorld.decompose(T.position,T.quaternion,T.scale);var I=this.scale;return y.translateOnAxis(s,I),T.translateOnAxis(a,I),n.getFrameData&&M?(n.depthNear=i.near,n.depthFar=i.far,n.getFrameData(M),y.projectionMatrix.elements=[].slice.call(M.leftProjectionMatrix),T.projectionMatrix.elements=[].slice.call(M.rightProjectionMatrix)):(y.projectionMatrix=z(p.fieldOfView,!0,i.near,i.far),T.projectionMatrix=z(g.fieldOfView,!0,i.near,i.far)),e.setViewport(r.x,r.y,r.width,r.height),e.setScissor(r.x,r.y,r.width,r.height),e.render(t,y),e.setViewport(o.x,o.y,o.width,o.height),e.setScissor(o.x,o.y,o.width,o.height),e.render(t,T),e.setViewport(0,0,v.width,v.height),e.setScissorTest(!1),N&&(t.autoUpdate=!0),void(c.autoSubmitFrame&&c.submitFrame())}e.render(t,i)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",g,!1)}}var zn=new u.SphereBufferGeometry(.1,32,32);function jn(e,t){Array.isArray(e)?e.forEach((function(e){e instanceof u.MeshBasicMaterial&&e.setValues({color:t})})):e instanceof u.MeshBasicMaterial&&e.setValues({color:t})}var fn=function(e){function n(){var t=e.call(this)||this,n=new u.MeshBasicMaterial({color:8900346,opacity:.5,transparent:!0});return t.mesh=new u.Mesh(zn,n),t.active=!1,t.current=!1,t.add(t.mesh),t}return t.__extends(n,e),n.prototype.isActive=function(){return this.active},n.prototype.isCurrent=function(){return this.current},n.prototype.setActive=function(){!0!==this.active&&(this.active=!0,jn(this.mesh.material,16776960))},n.prototype.setCurrent=function(){!0!==this.current&&(this.current=!0,jn(this.mesh.material,65280))},n.prototype.reset=function(){!1===this.current&&!1===this.active||(this.active=!1,this.current=!1,jn(this.mesh.material,8900346))},n.prototype.dispose=function(){this.remove(this.mesh),Array.isArray(this.mesh.material)?this.mesh.material.forEach((function(e){return e.dispose()})):this.mesh.material.dispose()},n}(u.Object3D);var vn=null,mn=function(e){function n(t){var i=this;j(vn)&&(vn=new N.default(t.webvrPolyfillConfig||{}));var r=n.parseArgs(t);i=e.call(this,r)||this;var o=r.element,s=r.renderer,a=r.panoIndex,M=void 0===a?0:a;i.effect=new Tn(s);var u=o.offsetWidth,c=o.offsetHeight;i.element=o,i.effect.setSize(u,c),i.effect.isPresenting=!0,i.panoSphereMeshes=i.work.observers.map((function(e,t){var n=new fn;return n.name="panoSphereMesh_"+t,n.position.copy(e.position),Object.assign(n,{panoIndex:t}),i.helper.add(n),n}));var l=i.work.observers[M].visibleNodes;l=l.filter((function(e){return i.work.observers[e].active}));var d=i.panoSphereMeshes.filter((function(e){return e.panoIndex===M}))[0];return i.panoSphereMeshes.forEach((function(e){if(e.visible=l.indexOf(e.panoIndex)>=0,d){var t=d.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),i.intersectMesh.parent&&i.intersectMesh.parent.remove(i.intersectMesh),i.initHelper(o),i}return t.__extends(n,e),n.parseArgs=function(n){var i=t.__assign(t.__assign({},n),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,i)},n.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},n.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.panoSphereMeshes&&(this.panoSphereMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoSphereMeshes.length=0),this.destroyHelper()},n.prototype.initHelper=function(e){for(var t="five_webvr_helper_"+m(),n=1,i=document.getElementsByTagName("meta"),r=0;r<i.length;r++){var o=i[r];if("viewport"===o.getAttribute("name")){var s=(o.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);s&&(n=Number(s[1])),isNaN(n)&&(n=1)}}var a=function(e){return Math.floor(e*n)+"px"},M=document.createElement("style"),u="\n ."+t+"{\n font-family:sans-serif;\n background:#394043;color:#ffffff;\n position:absolute;display:none;\n -webkit-tap-highlight-color:rgba(0,0,0,0);\n }\n ."+t+" img{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,-100%);\n -moz-transform:translate(-50%,-100%);\n transform:translate(-50%,-100%);\n pointer-events:none;\n width:"+a(132)+";\n height:"+a(162)+";\n }\n ."+t+" ol{\n position:absolute;top:50%;left:50%;\n -webkit-transform:translate(-50%,0);\n -moz-transform:translate(-50%,0);\n transform:translate(-50%,0);\n pointer-events:none;\n margin-top:"+a(38)+";\n font-size:"+a(16)+";\n line-height:"+a(30)+";\n }\n ."+t+" li{\n list-style-type:none;\n white-space:nowrap;\n position:relative;\n padding-left:"+a(14)+";\n }\n ."+t+" li:before{\n content:'';display:block;height:"+a(6)+";width:"+a(6)+";\n position:absolute;top:50%;left:0;\n -webkit-transform:translate(0,-50%);\n -moz-transform:translate(0,-50%);\n transform:translate(0,-50%);\n border-radius:50%;background:#ffffff;\n }\n @media screen and (orientation: portrait){\n ."+t+"{display: block!important}\n }\n ";M.setAttribute("type","text/css"),"styleSheet"in M?M.styleSheet.cssText=u:M.appendChild(document.createTextNode(u));var c=this.helperElement=document.createElement("div");c.className=t,c.innerHTML='\n <img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTMycHgiIGhlaWdodD0iMTYycHgiIHZpZXdCb3g9IjAgMCAxMzIgMTYyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA0Ni4xICg0NDQ2MykgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+R3JvdXA8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cG9seWdvbiBpZD0icGF0aC0xIiBwb2ludHM9IjY1Ljk4NTM0MjMgO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zMDgwOTMxLDU0LjQ1MTAxMjEgNzQuNTA0NjI5MSw1NC42MTIxMzMxIDc0LjYyNjY5NzUsNTQuODI1NzUyOCBaIiBpZD0iVHJpYW5nbGUiIGZpbGwtb3BhY2l0eT0iMC4yNjYwNDk1OTIiIGZpbGw9IiNGRkZGRkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDczLjc1ODUyMSwgNTguOTQxOTI3KSByb3RhdGUoMTgwLjAwMDAwMCkgdHJhbnNsYXRlKC03My43NTg1MjEsIC01OC45NDE5MjcpICI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4="/>\n <ol style="">\n <li>进入:将手机横屏放入VR眼镜中</li>\n <li>前进:视角中心对准蓝点,直至变绿</li>\n <li>退出:将手机竖屏再触碰屏幕</li>\n </ol>\n ';var l=new p.default(c);e.parentNode&&(e.parentNode.insertBefore(M,e),e.parentNode.insertBefore(c,e),this.setHelperElementSize(),l.on("tap",this.vrWantsToExit.bind(this))),this.destroyHelper=function(){l.destroy(),M.parentNode&&M.parentNode.removeChild(M),c.parentNode&&c.parentNode.removeChild(c)}},n.prototype.setHelperElementSize=function(){if(this.helperElement){var e=this.renderer.domElement,t=new u.Vector2(e.offsetWidth,e.offsetHeight),n=t.x*this.scissor.left,i=t.y*(1-this.scissor.bottom-this.scissor.height),r=t.x*this.scissor.width,o=t.y*this.scissor.height;this.helperElement.style.marginLeft=n+"px",this.helperElement.style.marginTop=i+"px",this.helperElement.style.width=r+"px",this.helperElement.style.height=o+"px"}},n.prototype.destroyHelper=function(){},n.prototype.resize=function(){var e=this.element,t=e.offsetWidth,n=e.offsetHeight;this.effect.isPresenting=!1,this.effect.setSize(t,n),this.effect.isPresenting=!0,this.needsRender=!0,this.setHelperElementSize()},n.prototype.doMoveToPano=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];e.prototype.doMoveToPano.apply(this,n);var r=n[0],o=this.work.observers[r],s=o.visibleNodes;s=s.filter((function(e){return t.work.observers[e].active}));var a=this.panoSphereMeshes.filter((function(e){return e.panoIndex===r}))[0];this.panoSphereMeshes.forEach((function(e){if(e.visible=s.indexOf(e.panoIndex)>=0,a){var t=a.position.distanceTo(e.position)<5;e.visible=e.visible&&t}})),this.needsRender=!0},n.prototype.vrWantsToExit=function(){this.emit("vrWantsToExit")},n.prototype.onPanGesture=function(){},n.prototype.onTapGesture=function(){},n.prototype.onPinchGesture=function(){},n.prototype.onMouseMove=function(){},n.prototype.onMouseOut=function(){},n.prototype.renderIntersect=function(){var e=this,t=e.camera,n=e.model,i=e.intersectMesh,r=e.panoSphereMeshes,o=e.intersectCameraPosition,s=e.intersectCameraVector,a=e.intersectActiveSphereMesh,M=e.intersectActiveDate;if(i){a&&M&&I()-M>2e3&&(delete this.intersectActiveDate,a.setCurrent(),this.moveToPano(a.panoIndex,{},!0));var c=t.getWorldDirection(new u.Vector3);if(!(o&&s&&t.pose.offset.equals(o)&&c.equals(s))){var l=t.pose.offset.clone(),d=new u.Raycaster(l,c),N=null,p=null;if(!N)for(var h=0,D=r.filter((function(e){return e.visible}));h<D.length;h++){var g=D[h],y=d.intersectObject(g,!0)[0];if(y){N=y,p=g;break}}if(N||n.empty||(N=n.intersectRaycaster(d)[0]),N&&N.face){var T=N.face.normal,z=new u.Quaternion;z.setFromUnitVectors(new u.Vector3(0,0,-1),T),i.quaternion.copy(z);var j=T.clone().multiplyScalar(.05),f=N.point.clone().add(j);if(i.position.copy(f),i.visible=!0,this.emit("intersectionOnModelUpdate",N,i),r.forEach((function(e){return e.reset()})),p)(g=p).setActive(),this.intersectActiveSphereMesh!==g&&(this.intersectActiveSphereMesh=g,this.intersectActiveDate=I());else delete this.intersectActiveSphereMesh,delete this.intersectActiveDate}else i.visible=!1,this.emit("intersectionHidden"),delete this.intersectActiveSphereMesh,delete this.intersectActiveDate;this.intersectCameraPosition=t.pose.offset.clone(),this.intersectCameraVector=c.clone(),this.needsRender=!0}}},n.prototype.render=function(){var e=this,t=e.effect,n=e.camera,i=e.scene,r=t.getVRDisplay(),o=this.camera.pose,s=o.longitude,a=o.latitude;if(r){var M=r.getPose();if(j(M.orientation)||n.quaternion.fromArray(M.orientation),r.stageParameters){n.updateMatrix();var c=r.stageParameters.sittingToStandingTransform,l=new u.Matrix4;l.fromArray(c),n.applyMatrix4(l)}}n.updateMatrixWorld(),n.computePose();var d=this.camera.pose,N=d.longitude,p=d.latitude;s===N&&a===p||(this.emit("cameraDirectionUpdate",{longitude:N,latitude:p},!0),this.emit("cameraUpdate",this.camera.copyPose(),!0)),this.renderIntersect(),t.render(i,n)},n}(yn),wn=function(e){function n(t){var i=this,r=n.parseArgs(t);return(i=e.call(this,r)||this).on("panoWillArrive",(function(){return i.ready=!1})),i.on("panoArrived",(function(){return i.ready=!0})),i}return t.__extends(n,e),n.parseArgs=function(t){return e.parseArgs.call(this,t)},n.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},n.prototype.destroy=function(){e.prototype.destroy.call(this)},n.prototype.updateWork=function(e,t,n,i){return this.ready=!1,this.work=e,this.currentPanoIndex=t.panoIndex,this.hideIntersectMesh(),this.moveToPano(t.panoIndex,{duration:0,longitude:t.longitude,latitude:t.latitude,fov:t.fov},i),!0},n.prototype.moveToPano=function(e,t,n){void 0===t&&(t={});var i=this.work.observers[e];i&&this.moveToPosition(i.position,t,n)},n.prototype.moveToPosition=function(e,t,n){var i,r,o,s,a,M,c=this;void 0===t&&(t={});var l=this,d=l.camera,N=l.model,p=l.currentPanoIndex,h=t.duration,D=t.limit,g=void 0===D||D,y=t.easing,T=void 0===y?Je.Quadratic.InOut:y,z=this.calculateMovingDuration(h,d.pose.offset.distanceTo(e)),j=ut(this.work.observers,(function(t){return t.position.distanceTo(e)})),f=this.work.observers.indexOf(j);this.emit("moveToPano",f,n);var v=d.pose.longitude,m=d.pose.latitude,w=d.pose.fov,I=d.pose.offset.clone(),x=(null===(i=N.getMaterial())||void 0===i?void 0:i.modelAlpha)||0,L=null!==(o=null===(r=this.model.getMaterial())||void 0===r?void 0:r.perspToOrtho)&&void 0!==o?o:0,O=null!==(s=t.longitude)&&void 0!==s?s:v,A=null!==(a=t.latitude)&&void 0!==a?a:m,E=null!==(M=t.fov)&&void 0!==M?M:w,C=e.clone(),k={longitude:O,latitude:A,fov:E,offset:C.clone()};t.moveStartCallback&&t.moveStartCallback(f,k),this.emit("panoWillArrive",f,k,n),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition);var U=function(e){var t=e.progress;c.setModelAndBoundingUniforms({modelAlpha:it(x,1,t),perspToOrtho:it(L,0,Math.min(5*t,1))});var i=new u.Vector3(it(I.x,C.x,t),it(I.y,C.y,t),it(I.z,C.z,t));c.updateCamera({offset:i},n,g),t>.7&&(c.preventTapGesture=!1),c.emit("movingToPano",f,p,t),n&&c.lastMouseMoveEvent&&c.onMouseMove(c.lastMouseMoveEvent),c.needsRender=!0},S=function(){U({progress:1}),c.preventTapGesture=!1,c.emit("panoArrived",f,c.camera.copyPose(),n),c.needsRender=!0};if(this.preventTapGesture=!0,z>0?this.tweenPosition=Ke(z,T).onUpdate(U).onComplete((function(){c.tweenPosition&&c.tweenPosition.destroy(),delete c.tweenPosition,t.moveEndCallback&&t.moveEndCallback(f,c.camera.copyPose()),S()})).onCancel((function(){t.moveCancelCallback&&t.moveCancelCallback()})):S(),this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),v!==O||m!==A||w!==E){var b=function(e){var t=e.progress,i=rt(v,O,t),r=it(m,A,t),o=it(w,E,t);c.updateCamera({longitude:i,latitude:r,fov:o},n,g)},Q=function(){return b({progress:1})};z>0?this.tweenCoordinates=Ke(z,T).onUpdate(b).onComplete((function(){c.tweenCoordinates&&(c.tweenCoordinates.destroy(),delete c.tweenCoordinates),Q()})):Q()}},n.prototype.setModelAndBoundingUniforms=function(e){for(var t=0,n=[this.model];t<n.length;t++){n[t].setMaterial(e)}},n.prototype.onTapGesture=function(e){if(this.interiaMovement=!1,!0!==this.preventTapGesture){var t=this.camera,n=this.model,i=this.relativeClientPosition(e.center),r=new u.Raycaster;r.setFromCamera(i,t);var o=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",o,!0)||this.emit("wantsTapGesture",r,i))){var s=h(r);if(s&&s.face){var a=s.face.normal,M=s.point;if(new u.Vector3(0,1,0).angleTo(a)>Math.PI/3){var c=t.pose.offset.clone().setY(M.y),l=M.clone().sub(c).setLength(.3),d=M.clone().sub(l);r.set(d,new u.Vector3(0,-1,0)),s=h(r)}}if(s){var N=s.point.clone(),p=ut(this.work.observers.filter((function(e){return Math.abs(e.standingPosition.y-N.y)<1})),(function(e){return e.standingPosition.distanceTo(N)}));p&&(N.y=p.position.y,this.emit("gesture","tap",o,!0),this.emit("tapGesture",r,i),this.moveToPosition(N,{},!0))}}}function h(e){return(!0===n.empty?e.intersectObjects(n.children):n.intersectRaycaster(e))[0]}},n}(Ut),In=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=113,i=126,r=0,o="";return arguments[r].split(o).map((function(e){return e.charCodeAt(r)>i?e:String.fromCharCode((e.charCodeAt(r)+n)%i)})).join(o)}("{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-]Vl?-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-<-]Vl?9-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"),xn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=113,i=126,r=0,o="";return arguments[r].split(o).map((function(e){return e.charCodeAt(r)>i?e:String.fromCharCode((e.charCodeAt(r)+n)%i)})).join(o)}("{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"),Ln=function(e){return{value:e}},On=Object.assign({opacity:Ln(1),scale:Ln(13.1),panoMap:Ln(null),panoDisplacementMap:Ln(null),panoPosition:Ln(new u.Vector3),panoMatrix:Ln(new u.Matrix4)},{emissive:Ln(new u.Color(0)),emissiveMap:Ln(null),specular:Ln(new u.Color(1118481)),specularMap:Ln(null),normalMap:Ln(null),bumpMap:Ln(null),shininess:Ln(30)},u.UniformsLib.common,u.UniformsLib.lights),An=new u.SphereBufferGeometry(.01,128,128),En=function(e){function n(t){var n=e.call(this)||this;return n.images=[null,null],n.xhr=[null,null],n.aborted=!1,n.cubeTextureLoader=new It(t),n.renderer=t,n}return t.__extends(n,e),n.prototype.load=function(e,t){var n=this,i=f,r=f,o=f,s=f;"function"==typeof t?(i=t.bind(this,null),o=t.bind(this),s=t.bind(this)):(t.onLoad&&(i=t.onLoad),t.onProgress&&(r=t.onProgress),t.onError&&(o=t.onError),t.onAbort&&(s=t.onAbort)),this.abort(),this.disposeImages(),this.aborted=!1;var a=[0,0];this.cubeTextureLoader.load(e,(function(t,r){if(t)o(t);else{var s=e.images.depth;n.xhr[0]=mt(s,(function(t){var o=Object.assign(n.toPanoModel(r,t,e.position,e.matrix),{hash:r.hash});i(o),n.emit("load",o,e)}),(function(e){return M(e,0)}),(function(e){return u(e,0)}),(function(){return c()}))}}));var M=function(t,i){n.aborted||(o(t),n.emit("error",t,e),n.xhr[i]=null,n.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null})),n.disposeImages())},u=function(t,i){a[i]=t,t=a.reduce((function(e,t){return e+t}),0)/a.length,r(t),n.emit("progress",t,e)},c=function(){n.aborted||(n.aborted=!0,n.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null})),n.disposeImages(),s(new Error("image aborted")),n.emit("abort",e))};this.emit("start",e)},n.prototype.abort=function(){this.xhr.forEach((function(e,t,n){e&&e.abort(),n[t]=null}))},n.prototype.disposeImages=function(){for(var e=0;e<this.images.length;e++)if(this.images[e]){var t=this.images[e];t&&vt(t),this.images[e]=null}},n.prototype.toPanoModel=function(e,t,n,i){var r=new u.ShaderMaterial({side:u.BackSide,vertexShader:In,fragmentShader:xn,transparent:!0,uniforms:u.UniformsUtils.clone(On)}),o=e;o.needsUpdate=!0,o.minFilter=u.LinearFilter,o.magFilter=u.LinearFilter;var s=t instanceof u.Texture?t:new u.Texture(t);return s.needsUpdate=!0,s.minFilter=u.LinearFilter,s.magFilter=u.LinearFilter,r.uniforms.opacity.value=0,r.uniforms.panoMap.value=o,r.uniforms.panoDisplacementMap.value=s,r.uniforms.panoPosition.value=n,r.uniforms.panoMatrix.value=i,Object.assign(new u.Mesh(An,r),{frustumCulled:!1,dispose:function(){this.material instanceof u.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})},n}(Re),Cn=function(e){function n(t){var i=this,r=n.parseArgs(t);return(i=e.call(this,r)||this).maxAccessibleDistance=r.maxAccessibleDistance,i.panoCircleMeshCreator=r.panoCircleMeshCreator,i.model.visible=!1,i.model.setMaterial({perspToOrtho:0}),i.boundingMesh=W(i.getBounding()),i.boundingMesh.setMaterial(i.model.getMaterial()||{}),i.boundingMesh.visible=!1,i.boundingMesh.renderOrder=2,i.boundingMesh.frustumCulled=!1,i.scene.add(i.boundingMesh),i.panoCircleMeshes=[],i.updatePanoCircleMeshes(),i.panoCircleMeshes.forEach((function(e){return e.visible=!1})),i.helper.remove(i.intersectMesh),i.depthTextureLoader=new En(i.renderer),i.depthTextureLoader.on("start",(function(e){var t,n=e.index;null===(t=i.panoCircleMeshes[n])||void 0===t||t.setProgress(0),i.emit("textureStartLoad",n,i.work.observers[n])})),i.depthTextureLoader.on("progress",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(e),i.emit("textureLoading",e,r,i.work.observers[r])})),i.depthTextureLoader.on("abort",(function(e){var t,n=e.index;null===(t=i.panoCircleMeshes[n])||void 0===t||t.setProgress(0),i.emit("textureAbort",n,i.work.observers[n])})),i.depthTextureLoader.on("load",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(1),i.emit("textureLoaded",r,i.work.observers[r])})),i.depthTextureLoader.on("error",(function(e,t){var n,r=t.index;null===(n=i.panoCircleMeshes[r])||void 0===n||n.setProgress(0),i.emit("textureError",e,r,i.work.observers[r])})),i.once("panoLoaded",(function(){i.boundingMesh.visible=!0,i.needsRender=!0})),i.on("panoWillArrive",(function(){return i.ready=!1})),i.on("moveToPanoCanceled",(function(){return i.ready=!0})),i.on("panoArrived",(function(){return i.ready=!0})),i}return t.__extends(n,e),n.parseArgs=function(n){var i,r,o=e.parseArgs.call(this,n);return t.__assign(t.__assign({},o),{maxAccessibleDistance:null!==(i=n.maxAccessibleDistance)&&void 0!==i?i:5,panoCircleMeshCreator:null!==(r=n.panoCircleMeshCreator)&&void 0!==r?r:Gt})},n.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},n.prototype.getBounding=function(){for(var e=new u.Box3,t=0,n=this.work.observers;t<n.length;t++){var i=n[t].standingPosition.clone();e.expandByPoint(i),i.y+=3,e.expandByPoint(i)}return e.max.x+=4,e.min.x-=4,e.max.z+=4,e.min.z-=4,e},n.prototype.updatePanoCircleMeshes=function(){var e=this,t=[],n=this.model;this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(n){n.loading&&t.push(n.panoIndex),e.helper.remove(n),n.dispose()})),this.panoCircleMeshes.length=0);var i=new u.Vector3(0,-1,0);this.panoCircleMeshes=this.work.observers.map((function(r,o){var s=e.panoCircleMeshCreator();if(s.position.copy(r.standingPosition),e.model.loaded){var a=s.position.clone().add(new u.Vector3(0,1,0)),M=new u.Raycaster(a,i,0,1),c=n.intersectRaycaster(M)[0];c&&(s.position.copy(c.point.clone()),s.needsRender=!0)}return s.name="panoCircle_"+o,s.panoIndex=o,e.helper.add(s),s.needsRender=!0,!1===r.active&&(s.setDisabled(!0),t.indexOf(o)>=0&&(s.setDisabled(!1),s.setLoading(!0))),s}));var r=this.work.observers[this.currentPanoIndex].visibleNodes;r=r.filter((function(t){var n=e.work.observers[t];return n.loadable||n.active})),this.panoCircleMeshes.forEach((function(e){e.visible=r.indexOf(e.panoIndex)>=0}));var o=this.camera.position;this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(o);e.setOpacity(Math.min(1.5/t,1))}))},n.prototype.destroy=function(){var t=this;e.prototype.destroy.call(this),this.depthTextureLoader.off(),delete this.pendingLoadTextureHashAndCallback,this.model&&(this.model.visible=!0),this.panoModel&&(this.scene.remove(this.panoModel),this.panoModel.dispose(),delete this.panoModel),this.boundingMesh&&(this.scene.remove(this.boundingMesh),this.boundingMesh.dispose()),this.panoCircleMeshes&&(this.panoCircleMeshes.forEach((function(e){t.helper.remove(e),e.dispose()})),this.panoCircleMeshes.length=0)},n.prototype.moveToPano=function(e,t,n){var i=this;void 0===t&&(t={}),this.interiaMovement=!1;var r={index:e,images:this.work.observers[e].images,imageOptions:this.imageOptions},o=d.digest(r),s=function(r,o){if(r)return t.moveCancelCallback&&t.moveCancelCallback(),i.emit("panoLoadError",r,e),void i.emit("moveToPanoCanceled",e);i.destroyed?null==o||o.dispose():(i.emit("panoLoaded",e),O((function(){return i.doMoveToPano(e,o,t,n)})))},a=this.pendingLoadTextureHashAndCallback||[],M=a[0],c=a[1];if(o!==M){if(delete this.pendingLoadTextureHashAndCallback,c&&c(new Error("texture aborted")),this.emit("moveToPano",e,n),this.emit("panoWillLoad",e),!r.images)return void s(new Error("pano images were not existed"));if(!r.images.depth)return void s(new Error("pano depth image were not existed"));var l=this.work.observers[e],N=l.position,p=l.quaternion,h=(new u.Matrix4).compose(N,p,new u.Vector3(-1,1,1)),D=Object.assign({position:N,matrix:h},r);this.pendingLoadTextureHashAndCallback=[o,s],this.depthTextureLoader.load(D,(function(e,t){var n=i.pendingLoadTextureHashAndCallback||[],r=n[0],s=n[1];o===r&&s?(s(e,t),delete i.pendingLoadTextureHashAndCallback):null==t||t.dispose()}))}},n.prototype.updateCamera=function(t,n,i){var r=this;e.prototype.updateCamera.call(this,t,n,i),this.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(r.camera.pose.offset);e.setOpacity(Math.min(1/t,1))}));var o=this.getForwardPanoIndexOrNot();null!==o&&this.panoCircleMeshes[o].setOpacity(1),ce()},n.prototype.canNotMoveAnimation=function(){var e=this;if(this.interiaMovement=!1,!this.tweenCoordinates){var t=this.camera.fov,n=.98*t,i=function(t){var n=t.fov;return e.updateCamera({fov:n},!0,!0)};this.tweenCoordinates=Xe({fov:t},{fov:n},200).onUpdate(i).onComplete((function(){var r;null===(r=e.tweenCoordinates)||void 0===r||r.destroy(),e.tweenCoordinates=Xe({fov:n},{fov:t},200).onUpdate(i).onComplete((function(){var t;null===(t=e.tweenCoordinates)||void 0===t||t.destroy(),delete e.tweenCoordinates}))}))}},n.prototype.doMoveToPano=function(e,t,n,i){var r,o,s,a=this;void 0===n&&(n={});var M=n.limit,c=void 0===M||M,l=n.easing,d=void 0===l?Je.Quadratic.InOut:l,N=this.currentPanoIndex,p=this.panoModel,h=this.currentPanoIndex,D=this.work.observers[e],g=function(e){return e.material.uniforms};if(p&&p instanceof u.ShaderMaterial){var y={pano0Map:g(p).panoMap.value,pano0Matrix:g(p).panoMatrix.value};g(p).opacity.value=1,this.boundingMesh.setMaterial(y)}t.renderOrder=-1;var T={progress:0,pano1Map:g(t).panoMap.value,pano1Matrix:g(t).panoMatrix.value};g(t).opacity.value=0,this.boundingMesh.setMaterial(T),this.model.setMaterial(T),this.panoModel=t,this.scene.add(t);var z=D.visibleNodes.filter((function(e){var t=a.work.observers[e];return t.loadable||t.active})),j=this.calculateMovingDuration(n.duration,this.camera.pose.offset.distanceTo(D.standingPosition)),f=this.camera.pose.longitude,v=this.camera.pose.latitude,m=this.camera.pose.offset.clone(),w=this.camera.fov,I=null!==(r=n.longitude)&&void 0!==r?r:f,x=null!==(o=n.latitude)&&void 0!==o?o:v,L=D.position,O=null!==(s=n.fov)&&void 0!==s?s:w,A={longitude:I,latitude:x,fov:O,offset:L.clone()};if(this.tweenCoordinates&&(this.tweenCoordinates.destroy(),delete this.tweenCoordinates),this.tweenPosition&&(this.tweenPosition.destroy(),delete this.tweenPosition),n.moveStartCallback&&n.moveStartCallback(e,A),this.emit("panoWillArrive",e,A,i),this.needsRender=!0,f!=f||v!==x||w!==O){var E=function(e){var t=e.progress,n=rt(f,I,t),r=it(v,x,t),o=it(w,O,t);a.updateCamera({longitude:n,latitude:r,fov:o},i,c),a.needsRender=!0},C=function(){return E({progress:1})};j>0?this.tweenCoordinates=Ke(j,d).onUpdate(E).onComplete((function(){var e;null===(e=a.tweenCoordinates)||void 0===e||e.destroy(),delete a.tweenCoordinates,C()})):C()}var k=function(){a.panoCircleMeshes.forEach((function(e){e.visible=z.indexOf(e.panoIndex)>=0})),g(t).opacity.value=0,t.material.depthTest=!0,p&&(a.scene.remove(p),p.material.uniforms.panoMap.value.dispose(),p.dispose()),a.updateCamera({offset:L},i,c);var r={progress:1,pano1Map:g(t).panoMap.value,pano1Position:g(t).panoPosition.value,pano1Matrix:g(t).panoMatrix.value,pano0Map:g(t).panoMap.value,pano0Position:g(t).panoPosition.value,pano0Matrix:g(t).panoMatrix.value,modelAlpha:0};a.boundingMesh.setMaterial(r),a.model.setMaterial(r),a.panoCircleMeshes[e]&&a.panoCircleMeshes[e].setProgress(0),n.moveEndCallback&&n.moveEndCallback(e,a.camera.copyPose()),a.currentPanoIndex=e,a.preventTapGesture=!1,a.emit("panoArrived",e,a.camera.copyPose(),i),a.needsRender=!0};this.preventTapGesture=!0,j>0&&h!==e?(this.panoCircleMeshes.forEach((function(e){return e.visible=!1})),t.material.depthTest=!1,p&&(p.material.depthTest=!1),this.tweenPosition=Ke(j,d).onUpdate((function(n){var r=n.progress,o=new u.Vector3(it(m.x,L.x,r),it(m.y,L.y,r),it(m.z,L.z,r));a.updateCamera({offset:o},i,c);var s=(Math.min(Math.max(r,.1),.9)-.1)/.8,M={modelAlpha:it(1,0,s)};g(t).opacity.value=it(0,1,s),p&&(g(p).opacity.value=1),a.boundingMesh.setMaterial(M),a.model.setMaterial(M),a.panoCircleMeshes.forEach((function(e){var t=e.position.distanceTo(o);e.setOpacity(Math.min(1.5/t,1))})),r>.7&&(a.preventTapGesture=!1),a.emit("movingToPano",e,N,r),a.needsRender=!0})).onComplete((function(){a.tweenPosition&&(a.tweenPosition.completed=!0,a.tweenPosition.destroy()),delete a.tweenPosition,k()})).onCancel((function(){n.moveCancelCallback&&n.moveCancelCallback(),a.emit("moveToPanoCanceled",e)}))):k()},n.prototype.getForwardPanoIndexOrNot=function(e){var t=this,n=this.camera,i=this.currentPanoIndex,r=this.work.observers[i].accessibleNodes;r=r.filter((function(e){var n=t.work.observers[e];return n.loadable||n.active}));var o,s=n.getWorldDirection(new u.Vector3);o=e?e.ray.direction.clone():s.clone();var a=n.pose.offset.clone();o.y=a.y=0;for(var M=0,c=r.filter((function(e){return t.work.observers[e].standingPosition.clone().sub(n.pose.offset).angleTo(s)<n.fov/2/180*Math.PI})).map((function(e){var n=t.work.observers[e].standingPosition.clone();return Object.assign(n,{y:0,panoIndex:e})})).sort((function(e,t){return e.distanceTo(a)-t.distanceTo(a)}));M<c.length;M++){var l=c[M],d=l.clone().sub(a);if(d.length()&&o.angleTo(d)<Math.PI/6)return l.panoIndex}return null},n.prototype.onTapGesture=function(e){var t=this;if(this.interiaMovement=!1,!0!==this.preventTapGesture){var n=this.camera,i=this.panoCircleMeshes,r=null,o=void 0,s=this.work.observers[this.currentPanoIndex].accessibleNodes;s=s.filter((function(e){return t.work.observers[e].position.distanceTo(n.pose.offset)<t.maxAccessibleDistance}));var a=this.relativeClientPosition(e.center),M=new u.Raycaster;M.setFromCamera(a,n);var c=e.pointers.map((function(e){return{x:e.x,y:e.y}}));if(!(this.emit("wantsGesture","tap",c,!0)||this.emit("wantsTapGesture",M,a))){var l=M.intersectObjects(this.boundingMesh.children)[0];if(l){var d=l.point.clone(),N=ut(i.filter((function(e){return s.indexOf(e.panoIndex)>=0})),(function(e){return e.position.distanceTo(d)}),!0),p=N[0];if(N[1]<1){var h=l.point.clone();r=p.panoIndex;var D=n.getWorldDirection(new u.Vector3).setY(0),g=(new u.Vector3).copy(h).setY(0).sub(n.pose.offset.clone().setY(0));if(D.angleTo(g)>Math.PI/6){var y=g.x,T=g.z;o={longitude:Math.atan2(-y,-T)}}}}if(j(r)&&!j(r=this.getForwardPanoIndexOrNot(M))&&l){var z=l.point,f=this.work.observers[r].position.clone();D=z.clone().setY(0).sub(n.getWorldDirection(new u.Vector3).setY(0)),g=z.clone().setY(0).sub(f.clone().setY(0));if(Math.abs(z.y-f.y)<.5&&D.angleTo(g)>Math.PI/6&&D.angleTo(g)<Math.PI/3){y=g.x,T=g.z;o={longitude:Math.atan2(-y,-T)}}}if(j(r))this.canNotMoveAnimation();else{var v=this.work.observers[r];this.emit("panoSelected",r),this.emit("gesture","tap",c,!0),this.emit("tapGesture",M,a),v.active?this.emit("wantsMoveToPano",r,o||{},!0):this.panoCircleMeshes[r]&&(this.panoCircleMeshes[r].setDisabled(!1),this.panoCircleMeshes[r].setLoading(!0))}}}},n}(Ut),kn=["Panorama","DepthPanorama","Model"],Un={Floorplan:Tt,Topview:zt,Panorama:yn,VRPanorama:mn,Model:wn,DepthPanorama:Cn};function Sn(e){for(var t=0,n=kn;t<n.length;t++){var i=n[t];if("string"==typeof e){if(i===e)return!0}else if(e instanceof yt&&e instanceof Un[i])return!0}return!1}var bn=["cameraDirectionUpdate","cameraUpdate","cameraPositionUpdate","panoSelected","moveToPano","moveToPanoCanceled","panoWillArrive","movingToPano","panoArrived","panoWillLoad","panoLoaded","panoLoadError","initAnimationEnded","initAnimationWillStart","wantsGesture","gesture","wantsTapGesture","tapGesture","wantsPanGesture","wantsInteriaPan","panGesture","interiaPan","wantsPinchGesture","pinchGesture","wantsMouseWheel","mouseWheel","wantsShowIntersectionOnModel","intersectionOnModelUpdate","intersectionHidden","textureStartLoad","textureLoading","textureAbort","textureLoaded","textureError"];function Qn(e){for(var t,n,i={},r=0,o=e.split(/(\;|\,)/);r<o.length;r++){var s=o[r].split("="),a=null===(t=s[0])||void 0===t?void 0:t.trim(),M=null===(n=s[1])||void 0===n?void 0:n.trim();a&&M&&(i[a]=M)}return i}function Yn(){for(var e,t=document.getElementsByTagName("meta"),n=0;n<t.length;n++){var i=t[n];if("viewport"===i.getAttribute("name")){var r=Qn(null!==(e=i.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var Pn=new u.Box3(new u.Vector3(-50,-50,-50),new u.Vector3(50,50,50)),_n=new u.Vector2,Bn=new u.Frustum,Rn=new u.Matrix4,Vn=new u.Clock,Fn=function(e){function n(t){var n,i,r,o,s,a,M,c,l,d,N,p;void 0===t&&(t={});var h=e.call(this)||this;if(h.ident=m(),h.panoIndex=0,h.needsRender=!1,h.onlyRenderIfNeeds=null===(n=t.onlyRenderIfNeeds)||void 0===n||n,h.maxFps=null!==(i=t.maxFps)&&void 0!==i&&i,h.imageOptions=t.imageOptions||{},h.textureOptions=t.textureOptions||h.imageOptions||{},h.extraElements=[],h.controllerInits={Panorama:null!==(r=t.panorama)&&void 0!==r?r:{},Model:null!==(o=t.model)&&void 0!==o?o:{},Floorplan:null!==(s=t.floorplan)&&void 0!==s?s:{},Topview:null!==(a=t.topview)&&void 0!==a?a:{},DepthPanorama:null!==(M=t.depthPanorama)&&void 0!==M?M:{},VRPanorama:null!==(c=t.vrPanorama)&&void 0!==c?c:{}},h.modeChangeDuration=null!==(l=t.modeChangeDuration)&&void 0!==l?l:1e3,h.panoramaLikeSavedPose={},t.renderer)t.renderer instanceof z&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=t.renderer;else try{h.renderer=new z({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias});var D=Yn();h.renderer.setPixelRatio(1===D?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(e){h.throwError(e)}h.getPixelsRenderTarget=new u.WebGLRenderTarget(1,1,{encoding:h.renderer.outputEncoding}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),h.camera=new y(80),h.scene=new T,h.model=new qe;var g=W(Pn);if(h.model.add(g),h.model.visible=!1,h.model.name="model_empty",h.model.empty=!0,h.model.loaded=!1,h.readyCallbacks=[],h.modelPending=!1,h.scene.add(h.model),h.helperGroup=new u.Group,h.helperGroup.name="helper",h.scene.add(h.helperGroup),h.videoTexture=new u.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}()),h.plugins={},t.plugins)for(var j=0,f=t.plugins;j<f.length;j++){var v=f[j];if("function"==typeof v)v(h);else if(Array.isArray(v)){var w=v[0],I=v[1],x=v[2],L=w(h,x);"string"==typeof I&&(h.plugins[I]&&h.throwError(new Error("plugin name "+I+" is exists.")),h.plugins[I]=L)}}return function(e){(t=new u.DirectionalLight(16777215,.5)).position.copy(new u.Vector3(1,1,1)),e.add(t);var t=new u.DirectionalLight(16777215,.3);e.add(t),t=new u.AmbientLight(16777215,.3),e.add(t)}(h.scene),h.state={mode:null!==(d=h.currentMode)&&void 0!==d?d:"Panorama",panoIndex:null!==(N=h.panoIndex)&&void 0!==N?N:0,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone()},h.stateSynced=!1,h.destroyed=!1,h.paused=!0,!1!==t.play&&h.play(),!1!==(null!==(p=t.initialBasisLoader)&&void 0!==p&&p)&&("string"==typeof t.initialBasisLoader?h.initBasisLoader(t.initialBasisLoader):h.initBasisLoader()),A((function(){return h.syncState()})),h}return t.__extends(n,e),n.prototype.dispose=function(){if(!0!==this.destroyed){this.emit("dispose"),this.destroyed=!0,this.pause(),this.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var e=this.getElement();e&&e.parentNode&&e.parentNode.removeChild(e),this.scene.remove(this.model);var t=this.model.getMaterial();t&&(t.pano0Map&&t.pano0Map.dispose(),t.pano1Map&&t.pano1Map!==t.pano0Map&&t.pano1Map.dispose()),this.renderer instanceof z&&this.renderer.forceContextLoss&&this.renderer.forceContextLoss()}},n.prototype.setScissor=function(e){Object.assign(this.scissor,e),this.controller&&this.controller.resize&&this.controller.resize()},Object.defineProperty(n.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}),n.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer instanceof z){e.appendChild(this.getElement()),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"))},n.prototype.refresh=function(e,t){void 0===e&&(e={});var n=this.getElement().parentNode;if(n&&n.nodeName){var i=e.width,r=void 0===i?n.offsetWidth:i,o=e.height,s=void 0===o?n.offsetHeight:o;this.renderer instanceof z&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(r,s))}var a=this.renderer.getSize(new u.Vector2);this.camera.aspect=a.x/a.y,this.scissor&&(this.camera.aspect*=this.scissor.width/this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.resize&&this.controller.resize(),this.needsRender=!0},n.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)}},n.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},n.prototype.getPose=function(){return this.camera.copyPose()},n.prototype.getSize=function(e){return this.renderer.getSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},n.prototype.getDrawingBufferSize=function(e){return this.renderer.getDrawingBufferSize(e),e.x*=this.scissor.width,e.y*=this.scissor.height,e},n.prototype.updateCamera=function(e,t){var n=this;return new Promise((function(i,r){if(n.controller){var o=n.getPose(),s=o.longitude,a=o.latitude,M=o.fov,c=o.offset,l=e.longitude,d=void 0===l?s:l,N=e.latitude,p=void 0===N?a:N,h=e.fov,D=void 0===h?M:h,g=e.offset,y=void 0===g?c.clone():g;n.controller.tweenCoordinates&&(n.controller.tweenCoordinates.destroy(),delete n.controller.tweenCoordinates),n.tweenCoordinates&&(n.tweenCoordinates.destroy(),delete n.tweenCoordinates);var T=n.tweenCoordinates=Ke(t,Je.Linear.None).onUpdate((function(e){var t,i=e.progress,r=rt(s,d,i),o=it(a,p,i),l=it(M,D,i),N=new u.Vector3(it(c.x,y.x,i),it(c.y,y.y,i),it(c.z,y.z,i));null===(t=n.controller)||void 0===t||t.updateCamera({longitude:r,latitude:o,fov:l,offset:N},!0,!0)})).onCancel((function(){for(var e=0,t=j;e<t.length;e++){(0,t[e])()}delete n.tweenCoordinates,console.log(new Error("updateCamera animation canceled")),r(new Error("updateCamera animation canceled"))})).onComplete((function(){for(var e=0,t=j;e<t.length;e++){(0,t[e])()}T.destroy(),delete n.tweenCoordinates,i()})),z=function(){return T.destroy()},j=[n.on("gesture",z),n.on("load",z)]}else{var f=new Error("controller never initialized");r(f)}}))},n.prototype.getLongitudeAndLatitude=function(){var e=this.getPose();return{longitude:e.longitude,latitude:e.latitude}},n.prototype.getOffset=function(){return this.getPose().offset},n.prototype.getCameraLocal=function(){if("number"==typeof this.panoIndex&&this.controller&&this.work){var e=this.work.observers[this.panoIndex],t=new u.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 n=new u.Vector3(0,0,-1);n.applyQuaternion(e.quaternion);var i=t.quaternion.clone().inverse();return n.applyQuaternion(i),{theta:Math.atan2(n.x,-n.z),phi:-Math.asin(n.y),lookAtVector:n}}(this.camera,t)}},n.prototype.initBasisLoader=function(e){try{if("undefined"==typeof Promise||"undefined"==typeof WeakMap||"undefined"==typeof WebAssembly)throw new Error("Basis loader not support.");"string"==typeof e&&Te.setResourcePath(e),Te.workerConfig.format||Te.detectSupport(this.renderer),Te._allocateWorker(0)}catch(e){this.throwError(e)}},n.prototype.load=function(e,i,r){var o,s,a,M,u,c,l,d,N,p,h,D,g=this,y=this.work,T=at(e);void 0===i&&(i=y?"inherit":"initial"),"inherit"===i?(p="number"==typeof this.panoIndex&&T.observers[this.panoIndex]?this.panoIndex:T.initial.panoIndex,h=null!==(o=this.currentMode)&&void 0!==o?o:T.initial.mode,D={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===i?(h=null!==(s=this.currentMode)&&void 0!==s?s:T.initial.mode,p=T.initial.panoIndex,D=h===n.Mode.Panorama||h===n.Mode.DepthPanorama||h===n.Mode.Model||h===n.Mode.VRPanorama?{longitude:T.initial.longitude,latitude:T.initial.latitude,fov:T.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(p=null!==(a=i.panoIndex)&&void 0!==a?a:T.initial.panoIndex,h=null!==(u=null!==(M=i.mode)&&void 0!==M?M:this.currentMode)&&void 0!==u?u:"Panorama",D={longitude:null!==(c=i.longitude)&&void 0!==c?c:T.initial.longitude,latitude:null!==(l=i.latitude)&&void 0!==l?l:T.initial.latitude,fov:null!==(d=i.fov)&&void 0!==d?d:T.initial.fov}),this.emit("willLoad",e,T,{panoIndex:p,mode:h,longitude:D.longitude,latitude:D.latitude,fov:D.fov});var z=function(){g.work=T,g.panoIndex=p,g.panoramaLikeSavedPose.longitude=T.initial.longitude,g.panoramaLikeSavedPose.latitude=T.initial.latitude,g.panoramaLikeSavedPose.fov=T.initial.fov;var n=null!=r?r:void 0===y?0:g.modeChangeDuration,i={panoIndex:p,longitude:D.longitude,latitude:D.latitude,fov:D.fov},o=t.__assign(t.__assign({panoIndex:p,initial:[{longitude:D.longitude,latitude:D.latitude,fov:D.fov},n,!0]},g.commonParams()),g.controllerInits[h]);g.controller?!1===g.controller.updateWork(T,i,n,!0)&&(g.controller.destroy(),g.controller=g.applyController(h,o)):g.controller=g.applyController(h,o),g.emit("load",e,T,{panoIndex:p,mode:h,longitude:D.longitude,latitude:D.latitude,fov:D.fov})},j=function(e,t){var n,i;void 0===t&&(t=f),e&&((null===(n=null==y?void 0:y.model)||void 0===n?void 0:n.file)!==(null===(i=T.model)||void 0===i?void 0:i.file)?(g.emit("modelWillLoad",e),g.loadModel(e,t,!0)):t&&(!0===g.model.loaded?t():g.once("modelLoaded",(function(){return t()}))))};return h===n.Mode.Floorplan||h===n.Mode.Topview||h===n.Mode.Model?j(T.model,(function(){z(),g.model.visible=!0,g.needsRender=!0})):(z(),null===(N=this.controller)||void 0===N||N.once("panoLoaded",(function(){g.model.visible=!0,j(T.model),g.needsRender=!0}))),this.ready()},n.prototype.changeMode=function(e,i,r,o){var s=this;return void 0===i&&(i={}),void 0===r&&(r=this.modeChangeDuration),void 0===o&&(o=!0),new Promise((function(a,M){var u;if(!n.Mode.hasOwnProperty(e)){var c=new Error('mode "'+e+'" is not existed');return s.throwError(c),void M(c)}if(e!==n.Mode.Floorplan&&e!==n.Mode.Topview&&e!==n.Mode.Model||!j(s.model)&&!0===s.model.loaded){if(j(s.controller))return s.currentMode=e,s.panoIndex=null!==(u=i.panoIndex)&&void 0!==u?u:s.panoIndex,s.updateCamera(i,r);var l=s.controller,d=s.currentMode,N=function(){var u,c,N,p;if(s.emit("wantsChangeMode",e,d))M(new Error("change mode canceled."));else{if(s.controller&&d===e)e===n.Mode.Panorama||e===n.Mode.DepthPanorama||e===n.Mode.Model||e===n.Mode.VRPanorama?"number"==typeof i.panoIndex&&i.panoIndex!==s.panoIndex?s.controller.moveToPano(null!==(c=null!==(u=i.panoIndex)&&void 0!==u?u:s.panoIndex)&&void 0!==c?c:0,t.__assign({duration:r},i),o):s.updateCamera(i,r).catch((function(){})):("number"==typeof i.panoIndex&&i.panoIndex!==s.panoIndex&&(s.panoIndex=s.controller.currentPanoIndex=i.panoIndex),s.updateCamera(i,r).catch((function(){})));else{l.destroy();var h=t.__assign(t.__assign({panoIndex:null!==(p=null!==(N=i.panoIndex)&&void 0!==N?N:s.panoIndex)&&void 0!==p?p:0,initial:[Sn(e)?s.panoramaLikeSavedPose:i,r,o]},s.commonParams()),s.controllerInits[e]);s.saveControllerPose(l),s.controller=s.applyController(e,h),s.controller.once("initAnimationWillStart",(function(t,n){s.emit("modeChange",e,d,t,n)})),s.emit("currentStateChange",s.getCurrentState(),o)}a()}};e===n.Mode.VRPanorama&&"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)N();else{var t=new Error("Request DeviceOrientation Permission denied.");s.throwError(t),M(t)}})).catch((function(e){s.throwError(e),M(e)})):N()}else{c=new Error("model is not ready.");s.throwError(c)}}))},n.prototype.getPixels=function(e,t,n,i,r){void 0===r&&(r=1);var o=this.getPixelsRenderTarget,s=this.renderer.getSize(new u.Vector2);e=Math.min(Math.max(e,Math.floor(n/2)),Math.floor(s.x-n)),t=Math.min(Math.max(t,Math.floor(i/2)),Math.floor(s.y-i)),e*=r,t*=r,n*=r,i*=r,o.setSize(s.x*r,s.y*r),o.scissor.set(e,t,n,i),o.scissorTest=!0,this.renderer.setRenderTarget(o);var a=new Uint8Array(n*i*4);return this.controller?this.controller.render(Vn.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.readRenderTargetPixels(o,e,t,n,i,a),this.renderer.setRenderTarget(null),o.setSize(1,1),o.scissor.set(0,0,0,0),o.scissorTest=!1,a},n.prototype.getElement=function(){return this.renderer.domElement},n.prototype.pause=function(){},n.prototype.render=function(e,t){var n=this;if(void 0===t&&(t=!1),t){var i=this.renderer.getSize(new u.Vector2);this.scene.traverseVisible((function(e){e.setResolution&&e.setResolution(i.x,i.y)}))}if(this.screenBuffer&&null===this.renderer.getRenderTarget()){var r=this.getDrawingBufferSize(_n);this.screenBuffer.setSize(r.x,r.y),this.renderer.setRenderTarget(this.screenBuffer),this.controller?this.controller.render(Vn.getDelta()):this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);var o=He(this.renderer.getContext());o&&this.throwError(o),e&&O(e)}else this.aroundScissor((function(){n.controller?n.controller.render(Vn.getDelta()):n.renderer.render(n.scene,n.camera);var t=He(n.renderer.getContext());t&&n.throwError(t),e&&O(e)}))},n.prototype.play=function(){var e=this;this.pause(),this.needsRender=!0;var t=I(),i=I(),r=0;this.paused=!1;var o=A((function(){var o,s;if(!0!==e.paused&&!e.destroyed){var a=I();if(e.maxFps){if(a-t+1<=1e3/e.maxFps)return;t=a}var M=e.renderer.getSize(new u.Vector2),c=[];Rn.multiplyMatrices(e.camera.projectionMatrix,e.camera.matrixWorldInverse),Bn.setFromProjectionMatrix(Rn),e.scene.traverse((function(e){e.setResolution&&e.setResolution(M.x,M.y),e.mixer instanceof u.AnimationMixer&&e.mixer.update(Vn.getDelta()),(e instanceof u.Mesh||e instanceof u.Line||e instanceof u.Points)&&(e instanceof u.ImmediateRenderObject||!e.frustumCulled||Bn.intersectsObject(e))&&c.push(e)}));var l=!1;if(e.currentMode!==n.Mode.VRPanorama&&e.onlyRenderIfNeeds){for(var d=0,N=c;d<N.length;d++){var p=N[d],h=function(t){!0===t.needsRender?(t.needsRender=!1,e.needsRender=!0):t.mixer&&t.mixer.stats.actions.inUse>0&&(e.needsRender=!0)};h(p),p.traverseAncestors(h)}e.controller&&!0===e.controller.needsRender&&(e.controller.needsRender=!1,e.needsRender=!0),!1!==e.needsRender&&(e.render(),l=!0)}else e.render(),l=!0;if(e.needsRender=!1,e.screenBuffer&&null===e.renderer.getRenderTarget()&&(null===(o=e.controller)||void 0===o?void 0:o.postProcessing)){var D=null===(s=e.controller)||void 0===s?void 0:s.postProcessing;e.aroundScissor((function(){return D(e.screenBuffer,Vn.getDelta())}))}e.hasListener("renderFrame")&&e.emit("renderFrame",l),e.hasListener("fps")&&(i&&a-i<1e3?r++:(i&&e.emit("fps",r),i=a,r=0))}}));this.pause=function(){e.paused=!0,o(),e.renderer&&e.renderer instanceof z&&e.renderer.clear(!0,!0,!0)}},n.prototype.moveToPano=function(e,t,i){var r;void 0===t&&(t={}),void 0===i&&(i=!0);var o=this.moveToPanoQueue=this.moveToPanoQueue||[],s=this.controller,a=this.currentMode;if(s)if(a===n.Mode.Floorplan||a===n.Mode.Topview)o.length=0,delete o.dequeue,j(e)||(this.panoIndex=e,this.changeMode(n.Mode.Panorama,t));else{if((null===(r=this.controller)||void 0===r?void 0:r.tweenPosition)||(o.length=0,delete o.dequeue),o.push([e,t,i]),o.length>2&&(o.length=2),o.dequeue)return;var M=function(){if(0!==o.length){var e=o.shift(),t=e[0],n=e[1],i=void 0===n?{}:n,r=e[2],a=Object.assign({},i);a.moveEndCallback=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.moveEndCallback&&(e=i.moveEndCallback.apply(this,t)),setTimeout(M),e},a.moveCancelCallback=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.moveCancelCallback&&(e=i.moveCancelCallback.apply(this,t)),setTimeout(M),e},s&&"moveToPano"in s&&O((function(){return s.moveToPano(t,a,r)}))}else delete o.dequeue};o.dequeue=!0,M()}},n.prototype.preloadPano=function(e,n){var i=this;if(void 0===n&&(n=f),!this.work)return Promise.reject(new Error("work never loaded"));var r=this.work.observers[e],o=I();return Promise.all(["right","left","up","down","front","back"].map((function(n){var o,s=t.__assign({key:["cube",e,n].join("."),basisLoaderInitialized:Te.isInitialized()},i.imageOptions);return o=ie(r.images[n],s),We[o]?We[o]:We[o]=new Promise((function(e){var t=document.createElement("link");t.href=o,t.rel="preload",t.as="fetch",Ge&&Ge.appendChild(t),t.onload=function(){return e()}}))}))).then((function(){var e=I()-o;return n(e),e}))},n.prototype.project2d=function(e,t){if(void 0===t&&(t=!1),!1===this.model.empty&&t){var n=this.camera.position,i=e.clone().sub(n),r=new u.Raycaster(n,i.clone().normalize()),o=this.model.intersectRaycaster(r)[0];if(o&&o.distance+.01<i.length())return null}var s=e.clone().project(this.camera);if(Math.abs(s.z)>1)return null;var a=this.renderer.getSize(new u.Vector2),M=a.x*this.scissor.width,c=a.y*this.scissor.height,l=a.x*this.scissor.left+(s.x+1)/2*M,d=a.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*c;return new u.Vector2(l,d)},n.prototype.getRenderObjects=function(e){Rn.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Bn.setFromProjectionMatrix(Rn),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof u.Mesh||e instanceof u.Line||e instanceof u.Points)&&(e instanceof u.ImmediateRenderObject||!e.frustumCulled||Bn.intersectsObject(e))&&t.push(e)})),t},n.prototype.getCurrentState=function(){return t.__assign(t.__assign({},this.camera.copyPose()),{mode:this.currentMode||n.Mode.Panorama,panoIndex:this.panoIndex||0})},n.prototype.setState=function(e,i){var r,o,s,a,M,u;void 0===i&&(i=!1);var c,l,d,N,p=null!==(r=e.panoIndex)&&void 0!==r?r:this.state.panoIndex,h=null!==(o=e.mode)&&void 0!==o?o:this.state.mode;if(e.mode!==n.Mode.Floorplan&&e.mode!==n.Mode.Topview&&e.mode!==n.Mode.Model||!j(this.model)&&!0===this.model.loaded){if(this.state.mode!==h){var D=void 0;D=Sn(this.state.mode)&&Sn(h)?this.state:Sn(h)?this.panoramaLikeSavedPose:e;var g=t.__assign(t.__assign({panoIndex:p,initial:[D,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[h]),y=Un[h].initAnimationEndPose(g);c=y.longitude,l=y.latitude,d=y.fov,N=y.offset}else c=null!==(s=e.longitude)&&void 0!==s?s:this.state.longitude,l=null!==(a=e.latitude)&&void 0!==a?a:this.state.latitude,d=null!==(M=e.fov)&&void 0!==M?M:this.state.fov,N=null!==(u=e.offset)&&void 0!==u?u:this.state.offset;this.emit("setState",{longitude:c,latitude:l,fov:d,offset:N,mode:h,panoIndex:p}),(p!==this.state.panoIndex||h!==this.state.mode||c!==this.state.longitude||l!==this.state.latitude||d!==this.state.fov||!N.equals(this.state.offset))&&(this.state.panoIndex=p,this.state.mode=h,this.state.longitude=c,this.state.latitude=l,this.state.fov=d,this.state.offset.copy(N),i&&this.syncState(i),this.emit("stateChange",this.state,!0))}else this.throwError(new Error("model is not ready."))},n.prototype.aroundScissor=function(e){var t=new u.Vector2,n=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||0!==this.scissor.height;if(n){this.renderer.getSize(t);var i=Math.floor(t.x*this.scissor.left),r=Math.floor(t.y*this.scissor.bottom),o=Math.floor(t.x*this.scissor.width),s=Math.floor(t.y*this.scissor.height);this.renderer.setViewport(i,r,o,s),this.renderer.setScissor(i,r,o,s),this.renderer.setScissorTest(!0)}e(),n&&(this.renderer.setViewport(0,0,t.x,t.y),this.renderer.setScissor(0,0,t.x,t.y),this.renderer.setScissorTest(!1))},n.prototype.syncState=function(e){if(void 0===e&&(e=!1),this.controller&&!1!==this.controller.ready&&!this.tweenCoordinates){if(this.readyCallbacks.length){var t=this.currentMode;if(!(t===n.Mode.Floorplan||t===n.Mode.Topview||t===n.Mode.Model)||!this.modelPending)for(var i=void 0;i=this.readyCallbacks.shift();)i()}var r=this.stateSynced;if(this.stateSynced=!1,this.state.mode===this.currentMode){if(this.controller instanceof Un.Model){if(!this.camera.pose.offset.equals(this.state.offset)){var o={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPosition(this.state.offset,o,!1)}}else if(this.state.panoIndex!==this.panoIndex){o={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return void this.controller.moveToPano(this.state.panoIndex,o,!1)}if(this.controller instanceof Un.Topview){var s=e?new u.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new u.Vector3(ot(this.camera.pose.offset.x,this.state.offset.x,.2),ot(this.camera.pose.offset.y,this.state.offset.y,.2),ot(this.camera.pose.offset.z,this.state.offset.z,.2));if(!this.camera.pose.offset.equals(s))return void this.controller.updateCamera({offset:s},!1,!1)}else{var a=Math.PI/45,M=e?this.state.fov:ot(this.camera.pose.fov,this.state.fov,1),c=e?{longitude:this.state.longitude,latitude:this.state.latitude}:function(e,t,n){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var i=et(e.longitude),r=e.latitude,o=et(t.longitude),s=t.latitude;o-i>tt?i+=nt:i-o>tt&&(i-=nt);var a=n/Math.sqrt(Math.pow(o-i,2)+Math.pow(s-r,2));return a>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:i+(o-i)*a,latitude:r+(s-r)*a}}({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},a),l=c.longitude,d=c.latitude;if(M!==this.camera.pose.fov||l!==this.camera.pose.longitude||d!==this.camera.pose.latitude)return this.controller.tweenCoordinates&&(this.controller.tweenCoordinates.destroy(),delete this.controller.tweenCoordinates),void this.controller.updateCamera({longitude:l,latitude:d,fov:M},!1,!1)}this.stateSynced=!0,!1===r&&this.emit("stateSynced",this.state)}else{var N={panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};this.changeMode(this.state.mode,N,this.modeChangeDuration,!1)}}},n.prototype.ready=function(){var e=this;return new Promise((function(t){return e.readyCallbacks.push(t)}))},n.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},n.prototype.loadModel=function(e,t,i){var r=this,o=e.async||!1;this.emit("modelWillLoad",e);var s=new qe;s.once("bvhLoaded",(function(){r.emit("modelBvhLoaded",s)})),s.once("geometryLoaded",(function(){r.emit("modelGeometryLoaded",s)})),s.on("error",(function(e){r.emit("modelLoadError",e,s),r.throwError(e),r.modelPending=!1})),s.on("shownFloorChange",(function(e,t){r.emit("modelShownFloorChange",e,t)})),s.once("loaded",(function(){var a;if(!r.destroyed){s.bounding.max.y-s.bounding.min.y<1.5&&(s.bounding.max.y=s.bounding.min.y+10);var M,u=r.model;u&&(u.show(),M=u.getMaterial()||{},r.scene.remove(u),u.dispose(),s.setTransparent(u.getTransparent())),r.model=Object.assign(s,{loaded:!0}),null===(a=r.controller)||void 0===a||a.resetModel(r.model,i),M&&r.model.setMaterial(M),u&&r.currentMode!==n.Mode.Panorama&&(o=!1);var c=function(){t(),r.emit("modelLoaded",s),O((function(){return r.emit("modelMaterialLoaded",s)})),e.bvh&&le((function(){return s.buildBVH()})),"function"==typeof gc&&gc(),r.needsRender=!0,r.modelPending=!1};if(o){var l=[].concat(r.model.children);r.model.children.length=0;var d=W(Pn);d.name="uniformKeeper",d.visible=!1,d.setMaterial(M||{}),r.model.add(d),r.scene.add(r.model);var N=function(){le((function(){var e=l.shift();e?(r.model.setMaterial.call(e,r.model.getMaterial()||{}),r.model.add(e),null===r.model.shownFloor?r.model.show():r.model.show(r.model.shownFloor),O(N,2)):(r.model.remove(d),c())}))};N()}else u?(r.scene.add(r.model),c()):le((function(){r.scene.add(r.model),c()}))}})),this.modelPending=!0,s.load(e,this.textureOptions)},n.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,helper:this.helperGroup,camera:this.camera,renderer:this.renderer,scissor:this.scissor,element:this.getElement(),model:this.model,work:this.work,imageOptions:this.imageOptions,extraElements:this.extraElements,videoTexture:this.videoTexture}},n.prototype.saveControllerPose=function(e){void 0===e&&(e=this.controller),e&&Sn(e)&&(this.panoramaLikeSavedPose.longitude=this.camera.pose.longitude,this.panoramaLikeSavedPose.latitude=this.camera.pose.latitude,this.panoramaLikeSavedPose.fov=this.camera.pose.fov)},n.prototype.applyController=function(e,i){var r=this,o=Un[e];e===this.currentMode||this.model.empty||this.model.show(),this.model.setTransparent(e===n.Mode.Floorplan||e===n.Mode.Topview||e===n.Mode.Model),this.currentMode=e;var s=new o(i);if(s.postProcessing){if(!this.screenBuffer){var a=this.getDrawingBufferSize(_n);this.screenBuffer=new u.WebGLRenderTarget(a.x,a.y,{encoding:this.renderer.outputEncoding})}}else this.screenBuffer&&(this.screenBuffer.dispose(),delete this.screenBuffer);for(var M=function(e){s.on(e,(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.emit.apply(r,t.__spreadArray([e],n));if(o)return!1}))},c=0,l=bn;c<l.length;c++){M(l[c])}return s.on("initAnimationWillStart",(function(t,n,i){i&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=n.longitude,r.state.latitude=n.latitude,r.state.fov=n.fov,r.state.offset.copy(n.offset),r.emit("stateChange",r.state,i))})),s.on("initAnimationEnded",(function(t,n,i){i&&(r.state.mode=e,r.state.panoIndex=t,r.state.longitude=n.longitude,r.state.latitude=n.latitude,r.state.fov=n.fov,r.state.offset.copy(n.offset),r.emit("stateChange",r.state,i))})),s.on("moveToPano",(function(e,t){r.emit("currentStateChange",r.getCurrentState(),t)})),s.on("panoWillArrive",(function(e,t,n){r.panoIndex=e,n&&(r.state.panoIndex=e,r.state.longitude=t.longitude,r.state.latitude=t.latitude,r.state.fov=t.fov,r.state.offset.copy(t.offset),r.emit("stateChange",r.state,n))})),s.on("panoArrived",(function(){"function"==typeof gc&&gc()})),s.on("wantsMoveToPano",(function(e,t,n){var i=r.emit("wantsMoveToPano",e,t,n);i||(i=r.emit("wantsToMoveToPano",e,t,n)),i||r.moveToPano(e,t,n)})),s.on("cameraUpdate",(function(e,t){t&&r.state.mode===r.currentMode&&r.state.panoIndex===r.panoIndex&&(r.state.longitude=e.longitude,r.state.latitude=e.latitude,r.state.fov=e.fov,r.state.offset.copy(e.offset),r.emit("stateChange",r.state,t)),r.emit("currentStateChange",r.getCurrentState(),t)})),s.on("vrWantsToExit",(function(){r.currentMode===n.Mode.VRPanorama&&r.changeMode(n.Mode.Panorama)})),s.on("error",(function(e){return r.emit("error",e)})),s},n.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",DepthPanorama:"DepthPanorama",VRPanorama:"VRPanorama"},n.Line=null,n.Easing=Je,n}(Re);exports.Camera=y,exports.Easing=Je,exports.Five=Fn,exports.HashCubeTexture=Y,exports.InternalWebGLRenderer=z,exports.Model=qe,exports.PBMContainer=U,exports.PBMGroup=S,exports.PBMMaterial=q,exports.PBMMesh=k,exports.PROXY_CONTROLLER_EVENT_NAMES=bn,exports.Scene=T,exports.Subscribe=Re,exports.getViewportScale=Yn,exports.parseWork=at,exports.stringifyWork=function(e){for(var t,n,i,r,o={pano_index:e.initial.panoIndex,pano:e.initial.panoIndex,longitude:e.initial.longitude,latitude:e.initial.latitude},s=null===(n=null===(t=e.model)||void 0===t?void 0:t.bvh)||void 0===n||n,a=null!==(r=null===(i=e.model)||void 0===i?void 0:i.async)&&void 0!==r&&r,M=e.model?{file_url:e.model.file,material_textures:e.model.textures.slice(),material_base_url:e.model.textureBase}:void 0,u={list:[]},c=[],l=0;l<e.observers.length;l++){var d=e.observers[l];c[l]={index:l,active:d.active,visible_nodes:d.visibleNodes.slice(),accessible_nodes:d.accessibleNodes.slice(),quaternion:{x:d.quaternion.x,y:d.quaternion.y,z:d.quaternion.z,w:d.quaternion.w},standing_position:d.standingPosition.toArray(),position:d.position.toArray(),floor:d.floorIndex,floor_index:d.floorIndex},u.list[l]={index:l,active:d.active,loadable:d.loadable,up:d.images.up,down:d.images.down,right:d.images.right,left:d.images.left,front:d.images.front,back:d.images.back},d.video&&(u.list[l].video={source:d.video.source,matrix:d.video.matrix.toArray(),size:d.video.size.toArray()}),d.images.depth&&(u.list[l].depth=d.images.depth),d.images.tiles&&(u.list[l].tiles=d.images.tiles)}var N={bvh:s,modelAsync:a,initial:o,observers:c,panorama:u};return M&&(N.model=M),N};
1
+ /**
2
+ * @realsee/five
3
+ *
4
+ * Generated: 2023-08-07
5
+ * Version: 5.0.0-alpha.210
6
+ *
7
+ * Terms:
8
+ * Realsee SDK License Agreement
9
+ *
10
+ * Update: July 28, 2021
11
+ *
12
+ * THIS LICENSE AGREEMENT BETWEEN YOU AND 【BEIKE REALSEE TECHNOLOGY (HK)
13
+ * LIMITED】(“Realsee”) FORMS A LEGALLY BINDING CONTRACT BETWEEN YOU AND REALSEE IN
14
+ * RELATION TO YOUR USE OF THE SDK. This License Agreement accompanies the Realsee
15
+ * Software Development Kit(s) for the software and related explanatory materials
16
+ * (the "SDK") and includes any upgrades, modified versions, updates, additions,
17
+ * and copies of the SDK licensed to You by Realsee.
18
+ * BY DOWNLOADING, INSTALLING, OR OTHERWISE ACCESSING OR USING THE SDK, YOU AGREE
19
+ * THAT YOU HAVE READ, UNDERSTOOD, AND AGREE TO BE BOUND BY THIS AGREEMENT. YOU ARE
20
+ * AGREEING ON YOUR OWN BEHALF AND/OR ON BEHALF OF YOUR COMPANY OR ORGANIZATION TO
21
+ * THE TERMS AND CONDITIONS STATED BELOW.
22
+ * This Agreement applies to Your use of the SDK in the country in which You
23
+ * legally install it (“Territory”) and is subject to the laws of such Territory
24
+ * and further subject to Section 12 below. Different terms, conditions, and
25
+ * limitations may apply to the use of the SDK in any additional countries.
26
+ * 1. DEFINITIONS.
27
+ * “Agreement” means this Realsee SDK License Agreement.
28
+ * “Developer”, “You” and “Your” means the person(s) or entity acquiring or using
29
+ * the SDK or otherwise exercising rights under the terms of this Agreement.
30
+ * “Documentation” means the technical or other specifications or documentation
31
+ * that Realsee may provide to You for use in connection with the SDK.
32
+ * “Integrated Product” means any software, website, or on-line service developed
33
+ * by You based on or using the SDK (collectively, the “Integrated Product”).
34
+ * “Intellectual Property” means any patents, patent rights, trademarks, service
35
+ * marks, registered and unregistered designs, applications for any of the
36
+ * foregoing, copyright, and any other similar protected rights in any country and
37
+ * to the extent recognised by any relevant jurisdiction as intellectual property,
38
+ * trade secrets, know-how and confidential information. Realsee reserves all
39
+ * rights not expressly granted to You.
40
+ * “Realsee” means [Beike Realsee Technology (HK) Limited, a company incorporated
41
+ * and validly existing under the laws of Hong Kong].
42
+ * “SDK” means the Realsee-proprietary Software Development Kits (SDK) provided
43
+ * hereunder, includes all development tools (including any compiler and debugger),
44
+ * application programming interfaces (“APIs”), libraries, binary utilities, header
45
+ * files, Documentation, content, data, code samples, and other materials provided
46
+ * to You in connection with this Agreement, whether delivered through a download,
47
+ * or any other media or form, and is licensed, not sold, to You by Realsee for use
48
+ * only under the terms of this Agreement. The terms of this Agreement will govern
49
+ * any updates provided by Realsee that replace and/or supplement the original SDK
50
+ * delivered to You, unless such update is accompanied by a separate license, in
51
+ * which case the terms of such license will govern.
52
+ * 2. LICENSED USES AND RESTRICTIONS.
53
+ * 2.1 Subject to the restrictions contained in this Section 2, Realsee grants to
54
+ * You during the term, a limited, non-exclusive, revocable, non-sublicensable,
55
+ * non-transferable license to install and use the SDK within the Territory only
56
+ * for the purpose of internal development.
57
+ * 2.2 Restrictions. You acknowledge and agree that, You shall not, and shall
58
+ * ensure that Your affiliates, employees, agents, representatives, officers,
59
+ * representatives, and subcontractors do not (directly or indirectly):
60
+ * 2.2.1 decompile, reverse engineer, disassemble or attempt to derive the source
61
+ * code of, those components of the SDK provided in object code form, or any part
62
+ * thereof;
63
+ * 2.2.2 remove, alter, or obscure any copyright notice or other proprietary rights
64
+ * notice on any part of the SDK;
65
+ * 2.2.3 sell, assign, pledge, rent, lease, lend, upload to or host on any website
66
+ * or server for use by any third party except You, redistribute, or sublicense the
67
+ * SDK (or any part thereof), or operate the SDK (or any part thereof) in the
68
+ * capacity of a service bureau or other hosted services provider, in whole or in
69
+ * part, nor may You enable others to do so;
70
+ * 2.2.4 or alter, modify, customize or improve the SDK, or any part thereof;
71
+ * 2.2.5 use the SDK (or any part thereof) for any illegal purpose, in any manner
72
+ * that is inconsistent with the terms of this Agreement, or to engage in any
73
+ * illegal activity;
74
+ * 2.2.6 use the SDK (or any part thereof) in any manner that may damage the
75
+ * operation of Realsee’s products or services; or
76
+ * 2.2.7 use the SDK or any information contained therein or otherwise provided by
77
+ * Realsee for the purpose of developing, or having developed, any product
78
+ * competitive with any Realsee product or service, as determined by Realsee in its
79
+ * sole discretion;
80
+ * 2.2.8 include any portion of the SDK in Your Developer products.
81
+ * 2.3 Realsee has the right to impose reasonable conditions such as a reasonable
82
+ * fee for use of the SDK in Integrated Product in the future.
83
+ * 2.4 You may make a limited number of copies of the SDK to be used by Your
84
+ * employees or consultants as provided herein, and not for general business
85
+ * purposes, and such employees or consultants shall be subject to the obligations
86
+ * and restrictions in this Agreement.
87
+ * 2.5 All licenses not expressly granted in this Agreement are reserved and no
88
+ * other licenses, immunity, or rights, express or implied, are granted by Realsee,
89
+ * by implication, estoppel, or otherwise.
90
+ * 3. CONFIDENTIALITY.
91
+ * The SDK and all source code, Documentation, specifications, engineering details,
92
+ * and related information pertaining to the SDK, whether in oral, written,
93
+ * graphic, or electronic form, are and shall remain the confidential and
94
+ * proprietary information of Realsee or its licensors (collectively, the
95
+ * “Confidential Information”). You shall (i) disclose Confidential Information to
96
+ * only those directors and employees (collectively, “Affiliates”) whose duties
97
+ * justify their need to know such information and who have been clearly informed
98
+ * of their obligation to maintain the confidential, proprietary, and/or trade
99
+ * secret status of such Confidential Information; and (ii) use Confidential
100
+ * Information solely in accordance with the license granted hereunder. In any
101
+ * event, You and Your Affiliates shall treat Confidential Information as strictly
102
+ * confidential and shall use the same care to prevent disclosure of such
103
+ * information as You use with respect to Your own similar confidential and/or
104
+ * proprietary information, which shall not be less than the care a reasonable
105
+ * person would use under similar circumstances. All Confidential Information, and
106
+ * any copies thereof, shall be returned promptly to Realsee upon request. You
107
+ * shall ensure that Your Affiliates comply with the provisions of this Section 3,
108
+ * and You shall be liable for any breach of this Section 3 resulting from the act
109
+ * or omission of any of Your Affiliates. You shall not disclose Confidential
110
+ * Information to any third party, including, without limitation, any of Your
111
+ * subcontractors.
112
+ * 4. PROPRIETARY RIGHTS.
113
+ * 4.1 As between You and Realsee, Realsee and/or its licensors retain ownership of
114
+ * all right, title, and interest in, to, and under the SDK, including, without
115
+ * limitation, all patents, copyrights, trade secrets, trademarks and other
116
+ * intellectual property and other proprietary rights therein, and reserve all
117
+ * rights not expressly granted to You.
118
+ * 4.2 The items contained in the SDK are the intellectual property of Realsee and
119
+ * its licensors and are protected by PRC copyright and patent law, international
120
+ * treaty provisions and applicable laws of the country in which it is being used.
121
+ * You agree to protect all copyright and other ownership interests of Realsee
122
+ * and/or its licensors in all items in the SDK supplied under this License
123
+ * Agreement. You agree that all copies of the items in the SDK, reproduced for any
124
+ * reason by You, contain the same copyright notices, and other proprietary notices
125
+ * as appropriate, as appear on or in the original items delivered by Realsee in
126
+ * the SDK. Realsee and/or its licensors retain title and ownership of the items in
127
+ * the SDK, the media on which it is loaded, and all subsequent copies, regardless
128
+ * of the form or media in or on which the original and other copies may exist.
129
+ * Except as stated above, this Agreement does not grant You any rights to patents,
130
+ * copyrights, trade secrets, trademarks or any other rights in respect to the
131
+ * items in the SDK.
132
+ * 5. TERM AND TERMINATION.
133
+ * 5.1 This Agreement is effective until terminated. Realsee has the right to
134
+ * terminate this Agreement immediately, without judicial intervention, if You fail
135
+ * to comply with any term herein. Upon any such termination You must remove all
136
+ * full and partial copies of the items in the SDK from Your computer and
137
+ * discontinue the use of the items in the SDK.
138
+ * 5.2 Realsee may at any time, terminate the Agreement with You if: (A) You have
139
+ * breached any provision of the Agreement; or (B) Realsee is required to do so by
140
+ * law; or (C) Realsee decides to no longer provide the SDK or certain parts of the
141
+ * SDK to users in the country in which You are resident or from which You use the
142
+ * service, or the provision of the SDK or certain SDK services to You by Realsee
143
+ * is, in Realsee's sole discretion, no longer legally or commercially viable.
144
+ * 5.3 When the Agreement comes to an end, all of the legal rights, obligations and
145
+ * liabilities that You and Realsee have benefited from, been subject to (or which
146
+ * have accrued over time whilst the Agreement has been in force) or which are
147
+ * expressed to continue indefinitely, shall be unaffected by this cessation, and
148
+ * the provisions of Section 3, 4, 6, 7 and 8 shall continue to apply to such
149
+ * rights, obligations and liabilities indefinitely.
150
+ * 6. DISCLAIMER OF WARRANTY.
151
+ * YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE
152
+ * LAW, USE OF THE SDK (OR ANY PART THEREOF) IS AT YOUR SOLE RISK AND THAT THE
153
+ * ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS
154
+ * WITH YOU. REALSEE LICENSES THE SDK TO YOU ONLY ON AN "AS-IS" BASIS. REALSEE
155
+ * MAKES NO REPRESENTATION WITH RESPECT TO THE ADEQUACY OF ANY ITEMS IN THE SDK,
156
+ * WHETHER OR NOT USED BY YOU IN THE DEVELOPMENT OF INTEGRATED PRODUCT, FOR ANY
157
+ * PARTICULAR PURPOSE OR WITH RESPECT TO THEIR ADEQUACY TO PRODUCE ANY PARTICULAR
158
+ * RESULT. REALSEE AND ITS LICENSORS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING
159
+ * OUT OF THIS AGREEMENT OR FROM THE DISTRIBUTION OR USE OF INTEGRATED PRODUCT
160
+ * CONTAINING PORTIONS OF THE SDK. REALSEE AND ITS LICENSORS DISCLAIM ALL
161
+ * WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED
162
+ * CONDITIONS OR WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
163
+ * OR NONINFRINGEMENT OF ANY THIRD PARTY RIGHT IN RESPECT OF THE ITEMS IN THE SDK
164
+ * OR ANY SERVICES RELATED TO THE SDK.
165
+ * REALSEE IS UNDER NO OBLIGATION TO PROVIDE ANY SUPPORT UNDER THIS LICENSE
166
+ * AGREEMENT, INCLUDING UPGRADES OR FUTURE VERSIONS OF THE SDK OR ANY PORTIONS
167
+ * THEREOF, TO YOU, END USER OR TO ANY OTHER PARTY.
168
+ * 7. LIMITATION OF LIABILITY.
169
+ * TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT WILL REALSEE OR ITS
170
+ * LICENSORS BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, OR
171
+ * CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE,
172
+ * LOSS OF BUSINESS, REVENUE, OR PROFITS, LOSS OF OPPORTUNITY (WHETHER DIRECT OR
173
+ * INDIRECT), CORRUPTION OR LOSS OF DATA, LOSS OF REPUTATION OR SAVINGS, DOWNTIME,
174
+ * OR DAMAGE TO, LOSS OF OR REPLACEMENT OF DATA OR TRANSACTIONS, COST OF
175
+ * PROCUREMENT OF SUBSTITUTE SERVICES, BUSINESS INTERRUPTION, OR ANY OTHER
176
+ * COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR INABILITY
177
+ * TO USE THE SDK (OR ANY PART THEREOF), ANY INTEGRATED PRODUCT, OR ANY THIRD PARTY
178
+ * SOFTWARE, APPLICATIONS, OR SERVICES IN CONJUNCTION WITH THE SDK (OR ANY PART
179
+ * THEREOF), HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT,
180
+ * OR OTHERWISE) AND EVEN IF REALSEE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
181
+ * DAMAGES. IN NO EVENT WILL REALSEE’S TOTAL LIABILITY TO YOU FOR ALL DAMAGES
182
+ * EXCEED ONE HUNDRED DOLLARS ($100.00). THE FOREGOING LIMITATIONS WILL APPLY EVEN
183
+ * IF THE ABOVE STATED REMEDY FAILS OF ITS ESSENTIAL PURPOSE. THE LIMITATIONS
184
+ * CONTAINED IN SECTIONS 6 AND THIS SECTION 7 ARE A FUNDAMENTAL PART OF THE BASIS
185
+ * OF REALSEE’S BARGAIN HEREUNDER, AND REALSEE WOULD NOT ENTER INTO THIS AGREEMENT
186
+ * OR PROVIDE YOU WITH ACCESS TO THE SDK ABSENT SUCH LIMITATIONS.
187
+ * 8. INDEMNIFICATION.
188
+ * To the extent permitted by applicable law, You agree to indemnify, defend and
189
+ * hold harmless Realsee, its affiliates and each of their directors, officers,
190
+ * employees, independent contractors, and agents (each a “Realsee Indemnified
191
+ * Party”) from any and all claims, losses, liabilities, damages, expenses, and
192
+ * costs (including without limitation attorneys’ fees and court costs) incurred by
193
+ * a Realsee Indemnified Party as a result of: (i) Your non-compliance with any
194
+ * terms of this Agreement; (ii) Your use of the SDK (or any part thereof); or
195
+ * (iii) Your use of any Integrated Product, including any claim that Integrated
196
+ * Product infringes the copyright, trademark, trade secret or other intellectual
197
+ * property right of a third party.
198
+ * 9. ACKNOWLEDGEMENTS.
199
+ * Portions of the SDK may utilize or include third party software and other
200
+ * copyrighted material. Acknowledgments, licensing terms, and disclaimers for such
201
+ * material are contained in Documentation for the SDK or may otherwise accompany
202
+ * such material, and Your use of such materials governed by their respective
203
+ * terms. In the event of conflict between the terms of this Agreement and an
204
+ * applicable open source or third party agreement, the open source or third party
205
+ * agreement will control solely with respect to the open source software or third
206
+ * party software. Moreover, You shall not subject any items (including not limited
207
+ * to source code, object code, and any software) included in the SDK to any open
208
+ * source license.
209
+ * 10. NON-BLOCKING OF REALSEE DEVELOPMENT.
210
+ * You acknowledge that Realsee is currently developing or may develop technologies
211
+ * and products in the future that have or may have design and/or functionality
212
+ * similar to Integrated Product that You may develop based on Your license herein.
213
+ * Nothing in this Agreement shall impair, limit or curtail Realsee's right to
214
+ * continue with its development, maintenance and/or distribution of Realsee's
215
+ * technology or products.
216
+ * 11. GENERAL.
217
+ * 11.1 Export Control. You may not use or otherwise export or re-export the SDK
218
+ * (or any part thereof) except as authorized by United States law and the laws of
219
+ * the jurisdiction(s) in which the SDK (or any part thereof) was obtained. In
220
+ * particular, but without limitation, the SDK may not be exported or re-exported
221
+ * (i) into any U.S. embargoed countries or (ii) to anyone on the U.S. Treasury
222
+ * Department's list of Specially Designated Nationals or the U.S. Department of
223
+ * Commerce Denied Person's List or Entity List. By using the SDK (or any part
224
+ * thereof), You represent and warrant that You are not located in any such country
225
+ * or on any such list.
226
+ * 11.2 Governing Law. This Agreement and the rights of the parties hereunder shall
227
+ * be governed by and construed in accordance with the laws of People’s Republic of
228
+ * China (for purpose of this Agreement, excluding Hong Kong, Taiwan, and Macau),
229
+ * without reference to its conflict of laws principles. Any dispute, controversy
230
+ * or claim arising from or in connection with this Agreement, or the breach,
231
+ * termination or invalidity thereof, shall be submitted to China International
232
+ * Economic and Trade Arbitration Commission (“CIETAC”) for arbitration in Beijing
233
+ * which shall be conducted in accordance with the CIETAC's arbitration rules in
234
+ * effect at the time of applying for arbitration. The arbitral award is final and
235
+ * binding upon both parties.
236
+ * 11.3 Severability. If any provision of this Agreement is held by a court of
237
+ * competent jurisdiction to be unenforceable for any reason, the remaining
238
+ * provisions hereof will be unaffected and remain in full force and effect.
239
+ * 11.4. Modifications. Realsee reserves the right, from time to time, with or
240
+ * without notice to You, to make revisions to this Agreement in our sole and
241
+ * absolute discretion. The most current version of this Agreement will supersede
242
+ * all previous versions and shall be made available on the website where the SDK
243
+ * is made available, or by such other means as Realsee may determine in its
244
+ * discretion. Any modified versions of this Agreement hereto shall take effect
245
+ * from the time that it is made available. You shall be responsible for regularly
246
+ * checking for notice of any such modifications. You agree that Your continued use
247
+ * of the SDK constitutes Your agreement to the modified Agreement.
248
+ * 11.5 Relationship of the Parties. This Agreement will not be construed as
249
+ * creating an agency, partnership, joint venture, fiduciary duty, or any other
250
+ * form of legal association between You and Realsee, and You will not represent to
251
+ * the contrary, whether expressly, by implication, appearance, or otherwise.
252
+ * 11.6 Entire Agreement; Governing Language. This Agreement constitutes the entire
253
+ * agreement between You and Realsee with respect to the use of the SDK licensed
254
+ * hereunder and supersedes all prior understandings regarding such subject matter.
255
+ * No amendment to or modification of this Agreement will be binding unless in
256
+ * writing and signed by Realsee. You and Realsee hereto confirm that this
257
+ * Agreement and all related documents shall be drafted in English.
258
+ */
259
+
260
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t=require("protobufjs/minimal");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=n(e),r=n(t),o=Number(i.REVISION);if(o<115||o>117)throw new Error('"Five" needs "THREE.js" version between 125 - 117.');
261
+ /**
262
+ * @license
263
+ * The 'jsrsasign'(RSA-Sign JavaScript Library) License
264
+ *
265
+ * Copyright (c) 2010-2021 Kenji Urushima
266
+ *
267
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
268
+ * of this software and associated documentation files (the "Software"), to deal
269
+ * in the Software without restriction, including without limitation the rights
270
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
271
+ * copies of the Software, and to permit persons to whom the Software is
272
+ * furnished to do so, subject to the following conditions:
273
+ *
274
+ * The above copyright notice and this permission notice shall be included in
275
+ * all copies or substantial portions of the Software.
276
+ *
277
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
278
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
279
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
280
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
281
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
282
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
283
+ * THE SOFTWARE.
284
+ *
285
+ * LICENSE: MIT License
286
+ */
287
+ /**
288
+ * @license
289
+ * RSA and ECC in JavaScript
290
+ *
291
+ * Copyright (c) 2003-2005 Tom Wu All Rights Reserved.
292
+ *
293
+ * Permission is hereby granted, free of charge, to any person obtaining
294
+ * a copy of this software and associated documentation files (the
295
+ * "Software"), to deal in the Software without restriction, including
296
+ * without limitation the rights to use, copy, modify, merge, publish,
297
+ * distribute, sublicense, and/or sell copies of the Software, and to
298
+ * permit persons to whom the Software is furnished to do so, subject to
299
+ * the following conditions:
300
+ *
301
+ * The above copyright notice and this permission notice shall be
302
+ * included in all copies or substantial portions of the Software.
303
+ *
304
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
305
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
306
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
307
+ *
308
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
309
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
310
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
311
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
312
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
313
+ *
314
+ * In addition, the following condition applies:
315
+ *
316
+ * All redistributions must retain an intact copy of this copyright notice
317
+ * and disclaimer.
318
+ *
319
+ * http://www-cs-students.stanford.edu/~tjw/jsbn/
320
+ * LICENSE: BSD License
321
+ * PART: ext/{base64,jsbn,jsbn2,prgn4,rng,rsa,rsa2}
322
+ */
323
+ /**
324
+ * @license
325
+ * CryptoJS
326
+ *
327
+ * Copyright (c) 2009-2013 Jeff Mott
328
+ *
329
+ * Permission is hereby granted, free of charge, to any person obtaining
330
+ * a copy of this software and associated documentation files (the
331
+ * "Software"), to deal in the Software without restriction, including
332
+ * without limitation the rights to use, copy, modify, merge, publish,
333
+ * distribute, sublicense, and/or sell copies of the Software, and to
334
+ * permit persons to whom the Software is furnished to do so, subject to
335
+ * the following conditions:
336
+ *
337
+ * The above copyright notice and this permission notice shall be
338
+ * included in all copies or substantial portions of the Software.
339
+ *
340
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
341
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
342
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
343
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
344
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
345
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
346
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
347
+ *
348
+ * https://code.google.com/p/crypto-js/wiki/License
349
+ * PART: ext/cryptojs
350
+ */var a,s={},l=l||function(e,t){var n={},i=n.lib={},r=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(o=0;o<r;o+=4)t[i+o>>>2]=n[o>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i<t;i+=4)n.push(4294967296*e.random()|0);return new o.init(n,t)}}),a=n.enc={},s=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new o.init(n,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new o.init(n,t)}},c=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,r=n.sigBytes,a=this.blockSize,s=r/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*l,r);if(l){for(var u=0;u<l;u+=a)this._doProcessBlock(i,u);var h=i.splice(0,l);n.sigBytes-=c}return new o.init(h,c)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=u.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){u.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=n.algo={};return n}(Math);function c(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function u(){return new c(null)}!function(e){for(var t=l,n=(r=t.lib).WordArray,i=r.Hasher,r=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},c=2,u=0;64>u;){var h;e:{h=c;for(var d=e.sqrt(h),p=2;p<=d;p++)if(!(h%p)){h=!1;break e}h=!0}h&&(8>u&&(o[u]=s(e.pow(c,.5))),a[u]=s(e.pow(c,1/3)),u++),c++}var f=[];r=r.SHA256=i.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=0;64>d;d++){if(16>d)f[d]=0|e[t+d];else{var p=f[d-15],A=f[d-2];f[d]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+f[d-7]+((A<<15|A>>>17)^(A<<13|A>>>19)^A>>>10)+f[d-16]}p=h+((l<<26|l>>>6)^(l<<21|l>>>11)^(l<<7|l>>>25))+(l&c^~l&u)+a[d]+f[d],A=((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+(i&r^i&o^r&o),h=u,u=c,c=l,l=s+p|0,s=o,o=r,r=i,i=p+A|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+l|0,n[5]=n[5]+c|0,n[6]=n[6]+u|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(r),t.HmacSHA256=i._createHmacHelper(r)}(Math),l.lib.Cipher||function(e){var t=(f=l).lib,n=t.Base,i=t.WordArray,r=t.BufferedBlockAlgorithm,o=f.enc.Base64,a=f.algo.EvpKDF,s=t.Cipher=r.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){r.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,i){return("string"==typeof n?A:p).encrypt(e,t,n,i)},decrypt:function(t,n,i){return("string"==typeof n?A:p).decrypt(e,t,n,i)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var c=f.mode={},u=function(e,t,n){var i=this._iv;i?this._iv=undefined:i=this._prevBlock;for(var r=0;r<n;r++)e[t+r]^=i[r]},h=(t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();h.Encryptor=h.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;u.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),h.Decryptor=h.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,r=e.slice(t,t+i);n.decryptBlock(e,t),u.call(this,e,t,i),this._prevBlock=r}}),c=c.CBC=h,h=(f.pad={}).Pkcs7={pad:function(e,t){for(var n,r=(n=(n=4*t)-e.sigBytes%n)<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(r);n=i.create(o,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:c,padding:h}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var d=t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),p=(c=(f.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var n=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return d.create({ciphertext:e,salt:n})}},t.SerializableCipher=n.extend({cfg:n.extend({format:c}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var r=e.createEncryptor(n,i);return t=r.finalize(t),r=r.cfg,d.create({ciphertext:t,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),f=(f.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=i.random(8)),e=a.create({keySize:t+n}).compute(e,r),n=i.create(e.words.slice(t),4*n),e.sigBytes=4*t,d.create({key:e,iv:n,salt:r})}},A=t.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:f}),encrypt:function(e,t,n,i){return n=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize),i.iv=n.iv,(e=p.encrypt.call(this,e,t,n.key,i)).mixIn(n),e},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),n=i.kdf.execute(n,e.keySize,e.ivSize,t.salt),i.iv=n.iv,p.decrypt.call(this,e,t,n.key,i)}})}(),function(){for(var e=l,t=e.lib.BlockCipher,n=e.algo,i=[],r=[],o=[],a=[],s=[],c=[],u=[],h=[],d=[],p=[],f=[],A=0;256>A;A++)f[A]=128>A?A<<1:A<<1^283;var v=0,m=0;for(A=0;256>A;A++){var g=(g=m^m<<1^m<<2^m<<3^m<<4)>>>8^255&g^99;i[v]=g,r[g]=v;var y=f[v],b=f[y],x=f[b],w=257*f[g]^16843008*g;o[v]=w<<24|w>>>8,a[v]=w<<16|w>>>16,s[v]=w<<8|w>>>24,c[v]=w,w=16843009*x^65537*b^257*y^16843008*v,u[g]=w<<24|w>>>8,h[g]=w<<16|w>>>16,d[g]=w<<8|w>>>24,p[g]=w,v?(v=y^f[f[f[x^y]]],m^=f[f[m]]):v=m=1}var M=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),r=this._keySchedule=[],o=0;o<n;o++)if(o<t)r[o]=e[o];else{var a=r[o-1];o%t?6<t&&4==o%t&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=M[o/t|0]<<24),r[o]=r[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)o=n-t,a=t%4?r[o]:r[o-4],e[t]=4>t||4>=o?a:u[i[a>>>24]]^h[i[a>>>16&255]]^d[i[a>>>8&255]]^p[i[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,u,h,d,p,r),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,r,o,a,s){for(var l=this._nRounds,c=e[t]^n[0],u=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],p=4,f=1;f<l;f++){var A=i[c>>>24]^r[u>>>16&255]^o[h>>>8&255]^a[255&d]^n[p++],v=i[u>>>24]^r[h>>>16&255]^o[d>>>8&255]^a[255&c]^n[p++],m=i[h>>>24]^r[d>>>16&255]^o[c>>>8&255]^a[255&u]^n[p++];d=i[d>>>24]^r[c>>>16&255]^o[u>>>8&255]^a[255&h]^n[p++],c=A,u=v,h=m}A=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[p++],v=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&c])^n[p++],m=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^n[p++],d=(s[d>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^n[p++],e[t]=A,e[t+1]=v,e[t+2]=m,e[t+3]=d},keySize:8});e.AES=t._createHelper(n)}(),"undefined"!=typeof navigator&&"Microsoft Internet Explorer"==navigator.appName?(c.prototype.am=function(e,t,n,i,r,o){for(var a=32767&t,s=t>>15;--o>=0;){var l=32767&this[e],c=this[e++]>>15,u=s*l+c*a;r=((l=a*l+((32767&u)<<15)+n[i]+(1073741823&r))>>>30)+(u>>>15)+s*c+(r>>>30),n[i++]=1073741823&l}return r},a=30):"undefined"!=typeof navigator&&"Netscape"!=navigator.appName?(c.prototype.am=function(e,t,n,i,r,o){for(;--o>=0;){var a=t*this[e++]+n[i]+r;r=Math.floor(a/67108864),n[i++]=67108863&a}return r},a=26):(c.prototype.am=function(e,t,n,i,r,o){for(var a=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],c=this[e++]>>14,u=s*l+c*a;r=((l=a*l+((16383&u)<<14)+n[i]+r)>>28)+(u>>14)+s*c,n[i++]=268435455&l}return r},a=28),c.prototype.DB=a,c.prototype.DM=(1<<a)-1,c.prototype.DV=1<<a;c.prototype.FV=Math.pow(2,52),c.prototype.F1=52-a,c.prototype.F2=2*a-52;var h,d,p="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array;for(h="0".charCodeAt(0),d=0;d<=9;++d)f[h++]=d;for(h="a".charCodeAt(0),d=10;d<36;++d)f[h++]=d;for(h="A".charCodeAt(0),d=10;d<36;++d)f[h++]=d;function A(e){return p.charAt(e)}function v(e,t){var n=f[e.charCodeAt(t)];return null==n?-1:n}function m(e){var t=u();return t.fromInt(e),t}function g(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function y(e){this.m=e}function b(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},b.prototype.convert=function(e){var t=u();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(c.ZERO)>0&&this.m.subTo(t,t),t},b.prototype.revert=function(e){var t=u();return e.copyTo(t),this.reduce(t),t},b.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],i=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,i,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},b.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},c.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},c.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},c.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var i=e.length,r=!1,o=0;--i>=0;){var a=8==n?255&e[i]:v(e,i);a<0?"-"==e.charAt(i)&&(r=!0):(r=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),r&&c.ZERO.subTo(this,this)},c.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},c.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},c.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},c.prototype.lShiftTo=function(e,t){var n,i=e%this.DB,r=this.DB-i,o=(1<<r)-1,a=Math.floor(e/this.DB),s=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>r|s,s=(this[n]&o)<<i;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},c.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var i=e%this.DB,r=this.DB-i,o=(1<<i)-1;t[0]=this[n]>>i;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<r,t[a-n]=this[a]>>i;i>0&&(t[this.t-n-1]|=(this.s&o)<<r),t.t=this.t-n,t.clamp()}},c.prototype.subTo=function(e,t){for(var n=0,i=0,r=Math.min(e.t,this.t);n<r;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()},c.prototype.multiplyTo=function(e,t){var n=this.abs(),i=e.abs(),r=n.t;for(t.t=r+i.t;--r>=0;)t[r]=0;for(r=0;r<i.t;++r)t[r+n.t]=n.am(0,i[r],t,r,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&c.ZERO.subTo(t,t)},c.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var i=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,i,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},c.prototype.divRemTo=function(e,t,n){var i=e.abs();if(!(i.t<=0)){var r=this.abs();if(r.t<i.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=u());var o=u(),a=this.s,s=e.s,l=this.DB-g(i[i.t-1]);l>0?(i.lShiftTo(l,o),r.lShiftTo(l,n)):(i.copyTo(o),r.copyTo(n));var h=o.t,d=o[h-1];if(0!=d){var p=d*(1<<this.F1)+(h>1?o[h-2]>>this.F2:0),f=this.FV/p,A=(1<<this.F1)/p,v=1<<this.F2,m=n.t,y=m-h,b=null==t?u():t;for(o.dlShiftTo(y,b),n.compareTo(b)>=0&&(n[n.t++]=1,n.subTo(b,n)),c.ONE.dlShiftTo(h,b),b.subTo(o,o);o.t<h;)o[o.t++]=0;for(;--y>=0;){var x=n[--m]==d?this.DM:Math.floor(n[m]*f+(n[m-1]+v)*A);if((n[m]+=o.am(0,x,n,y,0,h))<x)for(o.dlShiftTo(y,b),n.subTo(b,n);n[m]<--x;)n.subTo(b,n)}null!=t&&(n.drShiftTo(h,t),a!=s&&c.ZERO.subTo(t,t)),n.t=h,n.clamp(),l>0&&n.rShiftTo(l,n),a<0&&c.ZERO.subTo(n,n)}}},c.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},c.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},c.prototype.exp=function(e,t){if(e>4294967295||e<1)return c.ONE;var n=u(),i=u(),r=t.convert(this),o=g(e)-1;for(r.copyTo(n);--o>=0;)if(t.sqrTo(n,i),(e&1<<o)>0)t.mulTo(i,r,n);else{var a=n;n=i,i=a}return t.revert(n)},c.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,i=(1<<t)-1,r=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(r=!0,o=A(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&i,s<=0&&(s+=this.DB,--a)),n>0&&(r=!0),r&&(o+=A(n));return r?o:"0"},c.prototype.negate=function(){var e=u();return c.ZERO.subTo(this,e),e},c.prototype.abs=function(){return this.s<0?this.negate():this},c.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},c.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)},c.prototype.mod=function(e){var t=u();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(c.ZERO)>0&&e.subTo(t,t),t},c.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new y(t):new b(t),this.exp(e,n)},c.ZERO=m(0),c.ONE=m(1),c.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},c.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),i=m(n),r=u(),o=u(),a="";for(this.divRemTo(i,r,o);r.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,r.divRemTo(i,r,o);return o.intValue().toString(e)+a},c.prototype.intValue=
351
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
352
+ function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},c.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1};
353
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
354
+ var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w="=";function M(e){var t,n,i,r="",o=0;for(t=0;t<e.length&&e.charAt(t)!=w;++t)(i=x.indexOf(e.charAt(t)))<0||(0==o?(r+=A(i>>2),n=3&i,o=1):1==o?(r+=A(n<<2|i>>4),n=15&i,o=2):2==o?(r+=A(n),r+=A(i>>2),n=3&i,o=3):(r+=A(n<<2|i>>4),r+=A(15&i),o=0));return 1==o&&(r+=A(n<<2)),r}
355
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */function C(e,t){return new c(e,t)}function E(e,t,n){for(var i="",r=0;i.length<t;)i+=n(String.fromCharCode.apply(String,e.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return i}function I(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function S(e,t,n){for(var i="",r=0;i.length<t;)i+=n(e+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])),r+=1;return i}function B(e){return M(function(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),(e=e.replace(/-/g,"+")).replace(/_/g,"/")}(e))}function T(e){return decodeURIComponent(function(e){return e.replace(/(..)/g,"%$1")}(e))}function P(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function R(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function L(e){return function(e){var t,n,i="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),i+=x.charAt(n>>6)+x.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),i+=x.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),i+=x.charAt(n>>2)+x.charAt((3&n)<<4));(3&i.length)>0;)i+=w;return i}(e)}function O(e,t){var n=function(e){var t=L(e).replace(/(.{64})/g,"$1\r\n");return t.replace(/\r\n$/,"")}(e);return"-----BEGIN "+t+"-----\r\n"+n+"\r\n-----END "+t+"-----\r\n"}function F(e,t){if(-1==e.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return function(e){return M(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function k(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=e.length)return 32==e.length?function(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),n=0;n<8;n++)t[n]=t[n].replace(/^0+/,""),""==t[n]&&(t[n]="0");var i=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(null===i)return e.slice(1,-1);var r="";for(n=0;n<i.length;n++)i[n].length>r.length&&(r=i[n]);return(e=e.replace(r,"::")).slice(1,-1)}(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}function D(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Q(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}I.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},I.prototype.setPublic=function(e,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof e)this.n=e,this.e=t;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA public key";this.n=C(e,16),this.e=parseInt(t,16)}},I.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)throw"Message too long for RSA";for(var n=new Array,i=e.length-1;i>=0&&t>0;){var r=e.charCodeAt(i--);r<128?n[--t]=r:r>127&&r<2048?(n[--t]=63&r|128,n[--t]=r>>6|192):(n[--t]=63&r|128,n[--t]=r>>6&63|128,n[--t]=r>>12|224)}n[--t]=0;for(var o=new SecureRandom,a=new Array;t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new c(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var i=n.toString(16);return 0==(1&i.length)?i:"0"+i},I.prototype.encryptOAEP=function(e,t,n){var i=function(e,t,n,i){var r=s.crypto.MessageDigest,o=s.crypto.Util,a=null;if(n||(n="sha1"),"string"==typeof n&&(a=r.getCanonicalAlgName(n),i=r.getHashLength(a),n=function(e){return P(o.hashHex(R(e),a))}),e.length+2*i+2>t)throw"Message too long for RSA";var l,u="";for(l=0;l<t-e.length-2*i-2;l+=1)u+="\0";var h=n("")+u+""+e,d=new Array(i);(new SecureRandom).nextBytes(d);var p=E(d,h.length,n),f=[];for(l=0;l<h.length;l+=1)f[l]=h.charCodeAt(l)^p.charCodeAt(l);var A=E(f,d.length,n),v=[0];for(l=0;l<d.length;l+=1)v[l+1]=d[l]^A.charCodeAt(l);return new c(v.concat(f))}(e,this.n.bitLength()+7>>3,t,n);if(null==i)return null;var r=this.doPublic(i);if(null==r)return null;var o=r.toString(16);return 0==(1&o.length)?o:"0"+o},I.prototype.type="RSA",I.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},I.prototype.setPrivate=function(e,t,n){if(this.isPrivate=!0,"string"!=typeof e)this.n=e,this.e=t,this.d=n;else{if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key";this.n=C(e,16),this.e=parseInt(t,16),this.d=C(n,16)}},I.prototype.setPrivateEx=function(e,t,n,i,r,o,a,s){if(this.isPrivate=!0,this.isPublic=!1,null==e)throw"RSASetPrivateEx N == null";if(null==t)throw"RSASetPrivateEx E == null";if(0==e.length)throw"RSASetPrivateEx N.length == 0";if(0==t.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=e&&null!=t&&e.length>0&&t.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=C(e,16),this.e=parseInt(t,16),this.d=C(n,16),this.p=C(i,16),this.q=C(r,16),this.dmp1=C(o,16),this.dmq1=C(a,16),this.coeff=C(s,16)},I.prototype.decrypt=function(e){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var t=C(e,16),n=this.doPrivate(t);return null==n?null:
356
+ /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */
357
+ function(e,t){for(var n=e.toByteArray(),i=0;i<n.length&&0==n[i];)++i;if(n.length-i!=t-1||2!=n[i])return null;for(++i;0!=n[i];)if(++i>=n.length)return null;for(var r="";++i<n.length;){var o=255&n[i];o<128?r+=String.fromCharCode(o):o>191&&o<224?(r+=String.fromCharCode((31&o)<<6|63&n[i+1]),++i):(r+=String.fromCharCode((15&o)<<12|(63&n[i+1])<<6|63&n[i+2]),i+=2)}return r}(n,this.n.bitLength()+7>>3)},I.prototype.decryptOAEP=function(e,t,n){if(e.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var i=C(e,16),r=this.doPrivate(i);return null==r?null:function(e,t,n,i){var r=s.crypto.MessageDigest,o=s.crypto.Util,a=null;for(n||(n="sha1"),"string"==typeof n&&(a=r.getCanonicalAlgName(n),i=r.getHashLength(a),n=function(e){return P(o.hashHex(R(e),a))}),e=e.toByteArray(),l=0;l<e.length;l+=1)e[l]&=255;for(;e.length<t;)e.unshift(0);if((e=String.fromCharCode.apply(String,e)).length<2*i+2)throw"Cipher too short";var l,c=e.substr(1,i),u=e.substr(i+1),h=S(u,i,n),d=[];for(l=0;l<c.length;l+=1)d[l]=c.charCodeAt(l)^h.charCodeAt(l);var p=S(String.fromCharCode.apply(String,d),e.length-i,n),f=[];for(l=0;l<u.length;l+=1)f[l]=u.charCodeAt(l)^p.charCodeAt(l);if((f=String.fromCharCode.apply(String,f)).substr(0,i)!==n(""))throw"Hash mismatch";var A=(f=f.substr(i)).indexOf("");if((-1!=A?f.substr(0,A).lastIndexOf("\0"):-1)+1!=A)throw"Malformed data";return f.substr(A+1)}(r,this.n.bitLength()+7>>3,t,n)},void 0!==s.lang&&s.lang||(s.lang={}),s.lang.String=function(){},s.lang.String.isHex=function(e){return D(e)},s.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};var N=function(e,t,n){return null==n&&(n="0"),e.length>=t?e:new Array(t-e.length+1).join(n)+e};void 0!==s.crypto&&s.crypto||(s.crypto={}),s.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:l.algo.MD5,sha1:l.algo.SHA1,sha224:l.algo.SHA224,sha256:l.algo.SHA256,sha384:l.algo.SHA384,sha512:l.algo.SHA512,ripemd160:l.algo.RIPEMD160},this.hashString=function(e,t){return new s.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new s.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")}},s.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=s.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=s.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=s.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=l.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(l.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=s.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},s.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},s.crypto.MessageDigest.getHashLength=function(e){var t=s.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},s.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},s.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var n="",i=t/4-e.length,r=0;r<i;r++)n+="0";return n+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new s.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var n=null;try{n=void 0===t?G.getKey(e):G.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.verify=function(e){if(this.sHashHex=this.md.digest(),this.pubKey instanceof I&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof I&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=s.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=G.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},s.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};var V,U,z,q,H,_,j,K,G=(V=function(e,t,n){return U(l.AES,e,t,n)},U=function(e,t,n,i){var r=l.enc.Hex.parse(t),o=l.enc.Hex.parse(n),a=l.enc.Hex.parse(i),s={};s.key=o,s.iv=a,s.ciphertext=r;var c=e.decrypt(s,o,{iv:a});return l.enc.Hex.stringify(c)},z=function(e,t,n){return q(l.AES,e,t,n)},q=function(e,t,n,i){var r=l.enc.Hex.parse(t),o=l.enc.Hex.parse(n),a=l.enc.Hex.parse(i),s=e.encrypt(r,o,{iv:a}),c=l.enc.Hex.parse(s.toString());return l.enc.Base64.stringify(c)},H={"AES-256-CBC":{proc:V,eproc:z,keylen:32,ivlen:16},"AES-192-CBC":{proc:V,eproc:z,keylen:24,ivlen:16},"AES-128-CBC":{proc:V,eproc:z,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,t,n){return U(l.TripleDES,e,t,n)},eproc:function(e,t,n){return q(l.TripleDES,e,t,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,t,n){return U(l.DES,e,t,n)},eproc:function(e,t,n){return q(l.DES,e,t,n)},keylen:8,ivlen:8}},_=function(e){var t={},n=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(t.cipher=n[1],t.ivsalt=n[2]);var i=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));i&&(t.type=i[1]);var r=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(r=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(r=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=r&&-1!=a){var s=e.substring(r+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},j=function(e,t,n){for(var i=n.substring(0,16),r=l.enc.Hex.parse(i),o=l.enc.Utf8.parse(t),a=H[e].keylen+H[e].ivlen,s="",c=null;;){var u=l.algo.MD5.create();if(null!=c&&u.update(c),u.update(o),u.update(r),c=u.finalize(),(s+=l.enc.Hex.stringify(c)).length>=2*a)break}var h={};return h.keyhex=s.substr(0,2*H[e].keylen),h.ivhex=s.substr(2*H[e].keylen,2*H[e].ivlen),h},K=function(e,t,n,i){var r=l.enc.Base64.parse(e),o=l.enc.Hex.stringify(r);return(0,H[t].proc)(o,n,i)},{version:"1.0.0",parsePKCS5PEM:function(e){return _(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return j(e,t,n)},decryptKeyB64:function(e,t,n,i){return K(e,t,n,i)},getDecryptedKeyHex:function(e,t){var n=_(e),i=n.cipher,r=n.ivsalt,o=n.data,a=j(i,t,r).keyhex;return K(o,i,a,r)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,i,r){var o="";if(void 0!==i&&null!=i||(i="AES-256-CBC"),void 0===H[i])throw"KEYUTIL unsupported algorithm: "+i;if(void 0===r||null==r){var a=function(e){var t=l.lib.WordArray.random(e);return l.enc.Hex.stringify(t)}(H[i].ivlen);r=a.toUpperCase()}var s=function(e,t,n,i){return(0,H[t].eproc)(e,n,i)}(t,i,j(i,n,r).keyhex,r);return o="-----BEGIN "+e+" PRIVATE KEY-----\r\n",o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+i+","+r+"\r\n",o+="\r\n",o+=s.replace(/(.{64})/g,"$1\r\n"),o+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=W,n=t.getChildIdx,i=t.getV,r={},o=n(e,0);if(2!=o.length)throw"malformed format: SEQUENCE(0).items != 2: "+o.length;r.ciphertext=i(e,o[1]);var a=n(e,o[0]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+a.length;if("2a864886f70d01050d"!=i(e,a[0]))throw"this only supports pkcs5PBES2";var s=n(e,a[1]);if(2!=a.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+s.length;var l=n(e,s[1]);if(2!=l.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length;if("2a864886f70d0307"!=i(e,l[0]))throw"this only supports TripleDES";r.encryptionSchemeAlg="TripleDES",r.encryptionSchemeIV=i(e,l[1]);var c=n(e,s[0]);if(2!=c.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length;if("2a864886f70d01050c"!=i(e,c[0]))throw"this only supports pkcs5PBKDF2";var u=n(e,c[1]);if(u.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+u.length;r.pbkdf2Salt=i(e,u[0]);var h=i(e,u[1]);try{r.pbkdf2Iter=parseInt(h,16)}catch(e){throw"malformed format pbkdf2Iter: "+h}return r},getPBKDF2KeyHexFromParam:function(e,t){var n=l.enc.Hex.parse(e.pbkdf2Salt),i=e.pbkdf2Iter,r=l.PBKDF2(t,n,{keySize:6,iterations:i});return l.enc.Hex.stringify(r)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=F(e,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(n),r=G.getPBKDF2KeyHexFromParam(i,t),o={};o.ciphertext=l.enc.Hex.parse(i.ciphertext);var a=l.enc.Hex.parse(r),s=l.enc.Hex.parse(i.encryptionSchemeIV),c=l.TripleDES.decrypt(o,a,{iv:s});return l.enc.Hex.stringify(c)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=W,n=t.getChildIdx,i=t.getV,r={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=n(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(r.algoid=i(e,a[0]),"06"==e.substr(a[1],2)&&(r.algparam=i(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return r.keyidx=t.getVidx(e,o[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=F(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new I;else if(s.crypto.DSA&&"2a8648ce380401"==n.algoid)t=new s.crypto.DSA;else{if(!s.crypto.ECDSA||"2a8648ce3d0201"!=n.algoid)throw"unsupported private key algorithm";t=new s.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=W.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new I;else if(s.crypto.DSA&&"2a8648ce380401"===n)t=new s.crypto.DSA;else{if(!s.crypto.ECDSA||"2a8648ce3d0201"!==n)throw"unsupported PKCS#8 public key hex";t=new s.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=W,n=t.getChildIdx,i=t.getV,r={};if("30"!=e.substr(0,2))throw"malformed RSA key(code:001)";var o=n(e,0);if(2!=o.length)throw"malformed RSA key(code:002)";if("02"!=e.substr(o[0],2))throw"malformed RSA key(code:003)";if(r.n=i(e,o[0]),"02"!=e.substr(o[1],2))throw"malformed RSA key(code:004)";return r.e=i(e,o[1]),r},parsePublicPKCS8Hex:function(e){var t=W,n=t.getChildIdx,i=t.getV,r={algparam:null},o=n(e,0);if(2!=o.length)throw"outer DERSequence shall have 2 elements: "+o.length;var a=o[0];if("30"!=e.substr(a,2))throw"malformed PKCS8 public key(code:001)";var s=n(e,a);if(2!=s.length)throw"malformed PKCS8 public key(code:002)";if("06"!=e.substr(s[0],2))throw"malformed PKCS8 public key(code:003)";if(r.algoid=i(e,s[0]),"06"==e.substr(s[1],2)?r.algparam=i(e,s[1]):"30"==e.substr(s[1],2)&&(r.algparam={},r.algparam.p=t.getVbyList(e,s[1],[0],"02"),r.algparam.q=t.getVbyList(e,s[1],[1],"02"),r.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw"malformed PKCS8 public key(code:004)";return r.key=i(e,o[1]).substr(2),r}});G.getKey=function(e,t,n){var i=(g=W).getChildIdx;g.getV;var r=g.getVbyList,o=s.crypto,a=o.ECDSA,l=o.DSA,u=I,h=F,d=G;if(void 0!==u&&e instanceof u)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==l&&e instanceof l)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(R=new u).setPublic(e.n,e.e),R;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(R=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),R;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(R=new u).setPrivate(e.n,e.e,e.d),R;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(R=new l).setPublic(e.p,e.q,e.g,e.y),R;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(R=new l).setPrivate(e.p,e.q,e.g,e.y,e.x),R;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(R=new u).setPublic(B(e.n),B(e.e)),R;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(R=new u).setPrivateEx(B(e.n),B(e.e),B(e.d),B(e.p),B(e.q),B(e.dp),B(e.dq),B(e.qi)),R;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(R=new u).setPrivate(B(e.n),B(e.e),B(e.d)),R;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=(P=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+B(e.x)).slice(-p)+("0000000000"+B(e.y)).slice(-p);return P.setPublicKeyHex(f),P}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=(P=new a({curve:e.crv})).ecparams.keylen/4,f="04"+("0000000000"+B(e.x)).slice(-p)+("0000000000"+B(e.y)).slice(-p);var A=("0000000000"+B(e.d)).slice(-p);return P.setPublicKeyHex(f),P.setPrivateKeyHex(A),P}if("pkcs5prv"===n){var v,m=e,g=W;if(9===(v=i(m,0)).length)(R=new u).readPKCS5PrvKeyHex(m);else if(6===v.length)(R=new l).readPKCS5PrvKeyHex(m);else{if(!(v.length>2&&"04"===m.substr(v[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(R=new a).readPKCS5PrvKeyHex(m)}return R}if("pkcs8prv"===n)return R=d.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return d._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return Y.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return Y.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var y=F(e,"PUBLIC KEY");return d._getKeyFromPublicPKCS8Hex(y)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=h(e,"RSA PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var x=r(k=h(e,"DSA PRIVATE KEY"),0,[1],"02"),w=r(k,0,[2],"02"),M=r(k,0,[3],"02"),C=r(k,0,[4],"02"),E=r(k,0,[5],"02");return(R=new l).setPrivate(new c(x,16),new c(w,16),new c(M,16),new c(C,16),new c(E,16)),R}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){b=h(e,"EC PRIVATE KEY");return d.getKey(b,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return d.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var S=d.getDecryptedKeyHex(e,t),T=new I;return T.readPKCS5PrvKeyHex(S),T}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var P,R=r(k=d.getDecryptedKeyHex(e,t),0,[1],"04"),L=r(k,0,[2,0],"06"),O=r(k,0,[3,0],"03").substr(2);if(void 0===s.crypto.OID.oidhex2name[L])throw"undefined OID(hex) in KJUR.crypto.OID: "+L;return(P=new a({curve:s.crypto.OID.oidhex2name[L]})).setPublicKeyHex(O),P.setPrivateKeyHex(R),P.isPublic=!1,P}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var k;x=r(k=d.getDecryptedKeyHex(e,t),0,[1],"02"),w=r(k,0,[2],"02"),M=r(k,0,[3],"02"),C=r(k,0,[4],"02"),E=r(k,0,[5],"02");return(R=new l).setPrivate(new c(x,16),new c(w,16),new c(M,16),new c(C,16),new c(E,16)),R}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return d.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},void 0!==s.asn1&&s.asn1||(s.asn1={}),s.asn1.ASN1Util={},s.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),i=(t=Math.floor(n/40)+"."+n%40,""),r=2;r<e.length;r+=2){var o=("00000000"+parseInt(e.substr(r,2),16).toString(2)).slice(-8);if(i+=o.substr(1,7),"0"==o.substr(0,1))t=t+"."+new c(i,2).toString(10),i=""}return t};var W=new function(){};function X(e){for(var t in s.crypto.Util.DIGESTINFOHEAD){var n=s.crypto.Util.DIGESTINFOHEAD[t],i=n.length;if(e.substring(0,i)==n)return[t,e.substring(i)]}return[]}function Y(e){var t,n=W,i=n.getChildIdx,r=n.getV,o=n.getTLV,a=n.getVbyList,l=n.getVbyListEx,c=n.getTLVbyList,u=n.getTLVbyListEx,h=n.getIdxbyList,d=n.getIdxbyListEx,p=n.getVidx,f=n.getInt,A=n.oidname,v=n.hextooidstr,m=F;try{t=s.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=c(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=c(e,0,[0]),n=f(t,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return l(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=u(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var n in t)if(e===t[n])return n;return A(l(e,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=a(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return n.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return G.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),i=c(this.hex,0,[0],"30"),r=new s.crypto.Signature({alg:t});return r.init(e),r.updateHex(i),r.verify(n)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=h(s,0,[0,7,0],"30"),o=i(s,t)}else{s=F(e);var l=h(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=r(s,l))return void(this.aExtInfo=new Array);t=h(s,0,[0,3,0,1,0],"30"),o=i(s,t),this.hex=s}this.aExtInfo=new Array;for(var c=0;c<o.length;c++){var u={critical:!1},d=0;3===i(s,o[c]).length&&(u.critical=!0,d=1),u.oid=n.hextooidstr(a(s,o[c],[0],"06"));var f=h(s,o[c],[1+d]);u.vidx=p(s,f),this.aExtInfo.push(u)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=s.asn1.x509.OID.name2oid(e)),""!==n)for(var i=0;i<t.length;i++)if(t[i].oid===n)return t[i]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"basicConstraints"};if(t&&(i.critical=!0),"3000"===e)return i;if("30030101ff"===e)return i.cA=!0,i;if("30060101ff02"===e.substr(0,12)){var a=r(e,10),s=parseInt(a,16);return i.cA=!0,i.pathLen=s,i}throw new Error("hExtV parse error: "+e)},this.getExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("keyUsage");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"keyUsage"};return t&&(i.critical=!0),i.names=this.getExtKeyUsageString(e).split(","),i},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=o(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var n="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(n=n.slice(-8)),10==e.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),n=new Array,i=0;i<t.length;i++)"1"==t.substr(i,1)&&n.push(Y.KEYUSAGE_NAME[i]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"subjectKeyIdentifier"};t&&(i.critical=!0);var a=r(e,0);return i.kid={hex:a},i},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var a={extname:"authorityKeyIdentifier"};t&&(a.critical=!0);for(var s=i(e,0),l=0;l<s.length;l++){var c=e.substr(s[l],2);if("80"===c&&(a.kid={hex:r(e,s[l])}),"a1"===c){var u=o(e,s[l]),h=this.getGeneralNames(u);a.issuer=h[0].dn}"82"===c&&(a.sn={hex:r(e,s[l])})}return a},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var a={extname:"extKeyUsage",array:[]};t&&(a.critical=!0);for(var s=i(e,0),l=0;l<s.length;l++)a.array.push(A(r(e,s[l])));return a},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=o(this.hex,e.vidx);if(""===n)return t;for(var a=i(n,0),s=0;s<a.length;s++)t.push(A(r(n,a[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"subjectAltName",array:[]};return t&&(i.critical=!0),i.array=this.getGeneralNames(e),i},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var i={extname:"issuerAltName",array:[]};return t&&(i.critical=!0),i.array=this.getGeneralNames(e),i},this.getGeneralNames=function(e){for(var t=i(e,0),n=[],r=0;r<t.length;r++){var a=this.getGeneralName(o(e,t[r]));void 0!==a&&n.push(a)}return n},this.getGeneralName=function(e){var t=e.substr(0,2),n=r(e,0),i=P(n);return"81"==t?{rfc822:i}:"82"==t?{dns:i}:"86"==t?{uri:i}:"87"==t?{ip:k(n)}:"a4"==t?{dn:this.getX500Name(n)}:void 0},this.getExtSubjectAltName2=function(){var e,t,n,a=this.getExtInfo("subjectAltName");if(void 0===a)return a;for(var s=new Array,l=o(this.hex,a.vidx),c=i(l,0),u=0;u<c.length;u++)n=l.substr(c[u],2),e=r(l,c[u]),"81"===n&&(t=T(e),s.push(["MAIL",t])),"82"===n&&(t=T(e),s.push(["DNS",t])),"84"===n&&(t=Y.hex2dn(e,0),s.push(["DN",t])),"86"===n&&(t=T(e),s.push(["URI",t])),"87"===n&&(t=k(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"cRLDistributionPoints",array:[]};t&&(r.critical=!0);for(var a=i(e,0),s=0;s<a.length;s++){var l=o(e,a[s]);r.array.push(this.getDistributionPoint(l))}return r},this.getDistributionPoint=function(e){for(var t={},n=i(e,0),r=0;r<n.length;r++){var a=e.substr(n[r],2),s=o(e,n[r]);"a0"==a&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},n=i(e,0),r=0;r<n.length;r++){var a=e.substr(n[r],2),s=o(e,n[r]);"a0"==a&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtInfo("cRLDistributionPoints");if(void 0===e)return e;for(var t=new Array,n=i(this.hex,e.vidx),r=0;r<n.length;r++)try{var o=T(a(this.hex,n[r],[0,0,0],"86"));t.push(o)}catch(e){}return t},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},n=i(this.hex,e.vidx),r=0;r<n.length;r++){var o=a(this.hex,n[r],[0],"06"),s=a(this.hex,n[r],[1],"86");"2b06010505073001"===o&&t.ocsp.push(T(s)),"2b06010505073002"===o&&t.caissuer.push(T(s))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"authorityInfoAccess",array:[]};t&&(r.critical=!0);for(var s=i(e,0),c=0;c<s.length;c++){var u=l(e,s[c],[0],"06"),h=T(a(e,s[c],[1],"86"));if("2b06010505073001"==u)r.array.push({ocsp:h});else{if("2b06010505073002"!=u)throw new Error("unknown method: "+u);r.array.push({caissuer:h})}}return r},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"certificatePolicies",array:[]};t&&(r.critical=!0);for(var a=i(e,0),s=0;s<a.length;s++){var l=o(e,a[s]),c=this.getPolicyInformation(l);r.array.push(c)}return r},this.getPolicyInformation=function(e){var t={},n=a(e,0,[0],"06");t.policyoid=A(n);var r=d(e,0,[1],"30");if(-1!=r){t.array=[];for(var s=i(e,r),l=0;l<s.length;l++){var c=o(e,s[l]),u=this.getPolicyQualifierInfo(c);t.array.push(u)}}return t},this.getPolicyQualifierInfo=function(e){var t={},n=a(e,0,[0],"06");if("2b06010505070201"===n){var i=l(e,0,[1],"16");t.cps=P(i)}else if("2b06010505070202"===n){var r=c(e,0,[1],"30");t.unotice=this.getUserNotice(r)}return t},this.getUserNotice=function(e){for(var t={},n=i(e,0),r=0;r<n.length;r++){var a=o(e,n[r]);"30"!=a.substr(0,2)&&(t.exptext=this.getDisplayText(a))}return t},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=P(r(e,0)),t},this.getExtCRLNumber=function(e,t){var n={extname:"cRLNumber"};if(t&&(n.critical=!0),"02"==e.substr(0,2))return n.num={hex:r(e,0)},n;throw new Error("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var n={extname:"cRLReason"};if(t&&(n.critical=!0),"0a"==e.substr(0,2))return n.code=parseInt(r(e,0),16),n;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var n={extname:"ocspNonce"};t&&(n.critical=!0);var i=r(e,0);return n.hex=i,n},this.getExtOcspNoCheck=function(e,t){var n={extname:"ocspNoCheck"};return t&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;e=o(this.hex,n.vidx),t=n.critical}var r={extname:"adobeTimeStamp"};t&&(r.critical=!0);var a=i(e,0);if(a.length>1){var s=o(e,a[1]),l=this.getGeneralName(s);null!=l.uri&&(r.uri=l.uri)}if(a.length>2){var c=o(e,a[2]);"0101ff"==c&&(r.reqauth=!0),"010100"==c&&(r.reqauth=!1)}return r},this.getX500NameRule=function(e){for(var t=null,n=[],i=0;i<e.length;i++)for(var r=e[i],o=0;o<r.length;o++)n.push(r[o]);for(i=0;i<n.length;i++){var a=n[i],l=a.ds,c=a.value,u=a.type;if("prn"!=l&&"utf8"!=l&&"ia5"!=l)return"mixed";if("ia5"==l){if("CN"!=u)return"mixed";if(s.lang.String.isMail(c))continue;return"mixed"}if("C"==u){if("prn"==l)continue;return"mixed"}if(null==t)t=l;else if(t!==l)return"mixed"}return null==t?"prn":t},this.getX500Name=function(e){var t=this.getX500NameArray(e);return{array:t,str:this.dnarraytostr(t)}},this.getX500NameArray=function(e){for(var t=[],n=i(e,0),r=0;r<n.length;r++)t.push(this.getRDN(o(e,n[r])));return t},this.getRDN=function(e){for(var t=[],n=i(e,0),r=0;r<n.length;r++)t.push(this.getAttrTypeAndValue(o(e,n[r])));return t},this.getAttrTypeAndValue=function(e){var t={type:null,value:null,ds:null},n=i(e,0),r=a(e,n[0],[],"06"),o=a(e,n[1],[]),l=s.asn1.ASN1Util.oidHexToInt(r);return t.type=s.asn1.x509.OID.oid2atype(l),t.ds=this.HEX2STAG[e.substr(n[1],2)],"bmp"!=t.ds?t.value=T(o):t.value=function(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2),16);if(0==t&n<128)return String.fromCharCode(n);if(t<8){var i=128|63&n;return T((192|(7&t)<<3|(192&n)>>6).toString(16)+i.toString(16))}i=128|(15&t)<<2|(192&n)>>6;var r=128|63&n;return T((224|(240&t)>>4).toString(16)+i.toString(16)+r.toString(16))})).join("")}(o),t},this.readCertPEM=function(e){this.readCertHex(m(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=O(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),e},this.getExtParamArray=function(e){null==e&&(-1!=d(this.hex,0,[0,"[3]"])&&(e=u(this.hex,0,[0,"[3]",0],"30")));for(var t=[],n=i(e,0),r=0;r<n.length;r++){var a=o(e,n[r]),s=this.getExtParam(a);null!=s&&t.push(s)}return t},this.getExtParam=function(e){var t=i(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var n=v(a(e,0,[0],"06")),r=!1;3==t&&"0101ff"==c(e,0,[1])&&(r=!0);var o=c(e,0,[t-1,0]),s=void 0;if("2.5.29.14"==n?s=this.getExtSubjectKeyIdentifier(o,r):"2.5.29.15"==n?s=this.getExtKeyUsage(o,r):"2.5.29.17"==n?s=this.getExtSubjectAltName(o,r):"2.5.29.18"==n?s=this.getExtIssuerAltName(o,r):"2.5.29.19"==n?s=this.getExtBasicConstraints(o,r):"2.5.29.31"==n?s=this.getExtCRLDistributionPoints(o,r):"2.5.29.32"==n?s=this.getExtCertificatePolicies(o,r):"2.5.29.35"==n?s=this.getExtAuthorityKeyIdentifier(o,r):"2.5.29.37"==n?s=this.getExtExtKeyUsage(o,r):"1.3.6.1.5.5.7.1.1"==n?s=this.getExtAuthorityInfoAccess(o,r):"2.5.29.20"==n?s=this.getExtCRLNumber(o,r):"2.5.29.21"==n?s=this.getExtCRLReason(o,r):"1.3.6.1.5.5.7.48.1.2"==n?s=this.getExtOcspNonce(o,r):"1.3.6.1.5.5.7.48.1.5"==n?s=this.getExtOcspNoCheck(o,r):"1.2.840.113583.1.1.9.1"==n&&(s=this.getExtAdobeTimeStamp(o,r)),null!=s)return s;var l={extname:n,extn:o};return r&&(l.critical=!0),l},this.findExt=function(e,t){for(var n=0;n<e.length;n++)if(e[n].extname==t)return e[n];return null},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var e,t,n,i,r=function(e){for(var t="",n=e.array,i=0;i<n.length;i++){var r=n[i];if(t+=" policy oid: "+r.policyoid+"\n",void 0!==r.array)for(var o=0;o<r.array.length;o++){var a=r.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",n=e.array,i=0;i<n.length;i++){var r=n[i];try{void 0!==r.dpname.full[0].uri&&(t+=" "+r.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==r.dname.full[0].dn.hex&&(t+=" "+Y.hex2dn(r.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",n=e.array,i=0;i<n.length;i++){var r=n[i];void 0!==r.caissuer&&(t+=" caissuer: "+r.caissuer+"\n"),void 0!==r.ocsp&&(t+=" ocsp: "+r.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Q(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Q(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var l=0;l<n.length;l++){var c=n[l],u=s.asn1.x509.OID.oid2name(c.oid);""===u&&(u=c.oid);var h="";if(!0===c.critical&&(h="CRITICAL"),e+=" "+u+" "+h+":\n","basicConstraints"===u){var d=this.getExtBasicConstraints();void 0===d.cA?e+=" {}\n":(e+=" cA=true",void 0!==d.pathLen&&(e+=", pathLen="+d.pathLen),e+="\n")}else if("keyUsage"===u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===u){var p=this.getExtAuthorityKeyIdentifier();void 0!==p.kid&&(e+=" kid="+p.kid.hex+"\n")}else{if("extKeyUsage"===u)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===u)e+=" "+(i=this.getExtSubjectAltName(),JSON.stringify(i.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===u)e+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===u)e+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"===u&&(e+=r(this.getExtCertificatePolicies()))}}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):s.lang.String.isHex(e)&&this.readCertHex(e))}function Z(e){return l.SHA256(e).toString()}W.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},W.getL=function(e,t){var n=W.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},W.getVblen=function(e,t){var n;return""==(n=W.getL(e,t))?-1:("8"===n.substr(0,1)?new c(n.substr(2),16):new c(n,16)).intValue()},W.getVidx=function(e,t){var n=W.getLblen(e,t);return n<0?n:t+2*(n+1)},W.getV=function(e,t){var n=W.getVidx(e,t),i=W.getVblen(e,t);return e.substr(n,2*i)},W.getTLV=function(e,t){return e.substr(t,2)+W.getL(e,t)+W.getV(e,t)},W.getTLVblen=function(e,t){return 2+2*W.getLblen(e,t)+2*W.getVblen(e,t)},W.getNextSiblingIdx=function(e,t){return W.getVidx(e,t)+2*W.getVblen(e,t)},W.getChildIdx=function(e,t){var n,i,r,o=W,a=[];n=o.getVidx(e,t),i=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,i-=2),r=0;for(var s=n;r<=i;){var l=o.getTLVblen(e,s);if((r+=l)<=i&&a.push(s),s+=l,r>=i)break}return a},W.getNthChildIdx=function(e,t,n){return W.getChildIdx(e,t)[n]},W.getIdxbyList=function(e,t,n,i){var r,o,a=W;return 0==n.length?void 0!==i&&e.substr(t,2)!==i?-1:t:(r=n.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[r],n,i)},W.getIdxbyListEx=function(e,t,n,i){var r,o,a=W;if(0==n.length)return void 0!==i&&e.substr(t,2)!==i?-1:t;r=n.shift(),o=a.getChildIdx(e,t);for(var s=0,l=0;l<o.length;l++){var c=e.substr(o[l],2);if("number"==typeof r&&!a.isContextTag(c)&&s==r||"string"==typeof r&&a.isContextTag(c,r))return a.getIdxbyListEx(e,o[l],n,i);a.isContextTag(c)||s++}return-1},W.getTLVbyList=function(e,t,n,i){var r=W,o=r.getIdxbyList(e,t,n,i);return-1==o||o>=e.length?null:r.getTLV(e,o)},W.getTLVbyListEx=function(e,t,n,i){var r=W,o=r.getIdxbyListEx(e,t,n,i);return-1==o?null:r.getTLV(e,o)},W.getVbyList=function(e,t,n,i,r){var o,a,s=W;return-1==(o=s.getIdxbyList(e,t,n,i))||o>=e.length?null:(a=s.getV(e,o),!0===r&&(a=a.substr(2)),a)},W.getVbyListEx=function(e,t,n,i,r){var o,a,s=W;return-1==(o=s.getIdxbyListEx(e,t,n,i))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==r&&(a=a.substr(2)),a)},W.getInt=function(e,t,n){null==n&&(n=-1);try{var i=e.substr(t,2);if("02"!=i&&"03"!=i)return n;var r=W.getV(e,t);return"02"==i?parseInt(r,16):function(e){try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16),i=e.substr(2),r=parseInt(i,16).toString(2);return"0"==r&&(r="00000000"),r=r.slice(0,0-n),parseInt(r,2)}catch(e){return-1}}(r)}catch(e){return n}},W.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:function(e){if(!D(e))return null;try{var t=[],n=e.substr(0,2),i=parseInt(n,16);t[0]=new String(Math.floor(i/40)),t[1]=new String(i%40);for(var r=e.substr(2),o=[],a=0;a<r.length/2;a++)o.push(parseInt(r.substr(2*a,2),16));var s=[],l="";for(a=0;a<o.length;a++)128&o[a]?l+=N((127&o[a]).toString(2),7):(l+=N((127&o[a]).toString(2),7),s.push(new String(parseInt(l,2))),l="");var c=t.join(".");return s.length>0&&(c=c+"."+s.join(".")),c}catch(e){return null}}(W.getV(e,t))}catch(e){return n}},W.getOIDName=function(e,t,n){null==n&&(n=null);try{var i=W.getOID(e,t,n);if(i==n)return n;var r=s.asn1.x509.OID.oid2name(i);return""==r?i:r}catch(e){return n}},W.getString=function(e,t,n){null==n&&(n=null);try{return P(W.getV(e,t))}catch(e){return n}},W.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],i=e.substr(0,2),r=parseInt(i,16);n[0]=new String(Math.floor(r/40)),n[1]=new String(r%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var l=[],c="";for(s=0;s<a.length;s++)128&a[s]?c+=t((127&a[s]).toString(2),7):(c+=t((127&a[s]).toString(2),7),l.push(new String(parseInt(c,2))),c="");var u=n.join(".");return l.length>0&&(u=u+"."+l.join(".")),u},W.isContextTag=function(e,t){var n,i;e=e.toLowerCase();try{n=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&n);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((i=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&n)&&(31&n)==i))}catch(e){return!1}},W.isASN1HEX=function(e){var t=W;if(e.length%2==1)return!1;var n=t.getVblen(e,0),i=e.substr(0,2),r=t.getL(e,0);return e.length-i.length-r.length==2*n},W.checkStrictDER=function(e,t,n,i,r){var o=W;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!s.lang.String.isHex(e))throw new Error("not hex string");n=e.length,r=(i=e.length/2)<128?1:Math.ceil(i.toString(16))+1}if(o.getL(e,t).length>2*r)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>i)throw new Error("value of L too long than hex: idx="+t);var l=o.getTLV(e,t),c=l.length-2-o.getL(e,t).length;if(c!==2*a)throw new Error("V string length and L's value not the same:"+c+"/"+2*a);if(0===t&&e.length!=l.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+l.length);var u=e.substr(t,2);if("02"===u){var h=o.getVidx(e,t);if("00"==e.substr(h,2)&&e.charCodeAt(h+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(u,16)){for(var d=o.getVblen(e,t),p=0,f=o.getChildIdx(e,t),A=0;A<f.length;A++){p+=o.getTLV(e,f[A]).length,o.checkStrictDER(e,f[A],n,i,r)}if(2*d!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*d+"!="+p)}},W.oidname=function(e){var t=s.asn1;s.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==s.asn1&&s.asn1||(s.asn1={}),void 0!==s.asn1.x509&&s.asn1.x509||(s.asn1.x509={}),s.asn1.x509.AlgorithmIdentifier={},s.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},s.asn1.x509.OID=new function(e){this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var t=this.name2oidList[e],n=new s.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=n,n},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var t;if(e.match(/^\d+\.\d+\.[0-9.]+$/))t=e;else if(void 0!==this.atype2oidList[e])t=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw"AttributeType name undefined: "+e;t=this.name2oidList[e]}var n=new s.asn1.DERObjectIdentifier({oid:t});return this.objCache[e]=n,n}},s.asn1.x509.OID.oid2name=function(e){var t=s.asn1.x509.OID.name2oidList;for(var n in t)if(t[n]==e)return n;return""},s.asn1.x509.OID.oid2atype=function(e){var t=s.asn1.x509.OID.atype2oidList;for(var n in t)if(t[n]==e)return n;return e},s.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=s.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},I.getPosArrayOfChildrenFromHex=function(e){return W.getChildIdx(e,0)},I.getHexValueArrayOfChildrenFromHex=function(e){var t,n=W.getV,i=n(e,(t=I.getPosArrayOfChildrenFromHex(e))[0]),r=n(e,t[1]),o=n(e,t[2]),a=n(e,t[3]),s=n(e,t[4]),l=n(e,t[5]),c=n(e,t[6]),u=n(e,t[7]),h=n(e,t[8]);return(t=new Array).push(i,r,o,a,s,l,c,u,h),t},I.prototype.readPrivateKeyFromPEMString=function(e){var t=F(e),n=I.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},I.prototype.readPKCS5PrvKeyHex=function(e){var t=I.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},I.prototype.readPKCS8PrvKeyHex=function(e){var t,n,i,r,o,a,s,l,c=W,u=c.getVbyListEx;if(!1===c.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=u(e,0,[2,0,1],"02"),n=u(e,0,[2,0,2],"02"),i=u(e,0,[2,0,3],"02"),r=u(e,0,[2,0,4],"02"),o=u(e,0,[2,0,5],"02"),a=u(e,0,[2,0,6],"02"),s=u(e,0,[2,0,7],"02"),l=u(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,i,r,o,a,s,l)},I.prototype.readPKCS5PubKeyHex=function(e){var t=W,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var i=t.getChildIdx(e,0);if(2!==i.length||"02"!==e.substr(i[0],2)||"02"!==e.substr(i[1],2))throw new Error("wrong hex for PKCS#5 public key");var r=n(e,i[0]),o=n(e,i[1]);this.setPublic(r,o)},I.prototype.readPKCS8PubKeyHex=function(e){var t=W;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},I.prototype.readCertPubKeyHex=function(e,t){var n,i;(n=new Y).readCertHex(e),i=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(i)},I.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=C(t,16),i=this.n.bitLength();if(n.bitLength()>i)return!1;var r=this.doPublic(n).toString(16);if(r.length+3!=i/4)return!1;var o=X(r.replace(/^1f+00/,""));if(0==o.length)return!1;var a,l=o[0];return o[1]==(a=e,s.crypto.Util.hashString(a,l))},I.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=C(t,16);if(n.bitLength()>this.n.bitLength())return 0;var i=X(this.doPublic(n).toString(16).replace(/^1f+00/,""));return 0!=i.length&&(i[0],i[1]==e)},I.prototype.verifyPSS=function(e,t,n,i){var r=function(e){return s.crypto.Util.hashHex(e,n)}(R(e));return void 0===i&&(i=-1),this.verifyWithMessageHashPSS(r,t,n,i)},I.prototype.verifyWithMessageHashPSS=function(e,t,n,i){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r,o=new c(t,16),a=function(e){return s.crypto.Util.hashHex(e,n)},l=P(e),u=l.length,h=this.n.bitLength()-1,d=Math.ceil(h/8);if(-1===i||void 0===i)i=u;else if(-2===i)i=d-u-2;else if(i<-2)throw new Error("invalid salt length");if(d<u+i+2)throw new Error("data too long");var p=this.doPublic(o).toByteArray();for(r=0;r<p.length;r+=1)p[r]&=255;for(;p.length<d;)p.unshift(0);if(188!==p[d-1])throw new Error("encoded message does not end in 0xbc");var f=(p=String.fromCharCode.apply(String,p)).substr(0,d-u-1),A=p.substr(f.length,u),v=65280>>8*d-h&255;if(0!=(f.charCodeAt(0)&v))throw new Error("bits beyond keysize not zero");var m=pss_mgf1_str(A,f.length,a),g=[];for(r=0;r<f.length;r+=1)g[r]=f.charCodeAt(r)^m.charCodeAt(r);g[0]&=~v;var y=d-u-i-2;for(r=0;r<y;r+=1)if(0!==g[r])throw new Error("leftmost octets not zero");if(1!==g[y])throw new Error("0x01 marker not found");return A===P(a(R("\0\0\0\0\0\0\0\0"+l+String.fromCharCode.apply(String,g.slice(-i)))))},I.SALT_LEN_HLEN=-1,I.SALT_LEN_MAX=-2,I.SALT_LEN_RECOVER=-2,Y.hex2dn=function(e,t){void 0===t&&(t=0);var n=new Y;return W.getTLV(e,t),n.getX500Name(e).str},Y.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var n=new Array,i=W.getChildIdx(e,t),r=0;r<i.length;r++)n.push(Y.hex2attrTypeValue(e,i[r]));return(n=n.map((function(e){return e.replace("+","\\+")}))).join("+")},Y.hex2attrTypeValue=function(e,t){var n=W,i=n.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var r=n.getChildIdx(e,t);2!==r.length||e.substr(r[0],2);var o=i(e,r[0]),a=s.asn1.ASN1Util.oidHexToInt(o);return s.asn1.x509.OID.oid2atype(a)+"="+P(i(e,r[1]))},Y.getPublicKeyFromCertHex=function(e){var t=new Y;return t.readCertHex(e),t.getPublicKey()},Y.getPublicKeyFromCertPEM=function(e){var t=new Y;return t.readCertPEM(e),t.getPublicKey()},Y.getPublicKeyInfoPropOfCertPEM=function(e){var t,n,i=W.getVbyList,r={};return r.algparam=null,(t=new Y).readCertPEM(e),n=t.getPublicKeyHex(),r.keyhex=i(n,0,[1],"03").substr(2),r.algoid=i(n,0,[0,0],"06"),"2a8648ce3d0201"===r.algoid&&(r.algparam=i(n,0,[0,1],"06")),r},Y.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];var J,$=[(J=new Y,J.readCertPEM(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}(":::::ORTV[-PR_aVSVPNaR:::::ZVVS@\tPPNErtNVONtVWNZR}@]nU\0ZaZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\\QN>Z\tN\\Q^B[QqnS=\b\\QN>Zwp\\Q^B[QqnZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaPPNvVQ^fWX|gVup[N^ROO^NQttV]NQPPNt|PttVONZU|C\b\\@@e^Xv{[vTtd8`nyO@ebN[bqx=ng?\tS^w@|XAz|qUTwfzn]Bu<qs_ae\\y<}u`eRAoE`_\\s\0r|b{rp_o<oC@o=x\bw_cUUZPApQevD\\FxFoFgE=<sq[p<coqyn>TEpP@aSC_YDU8\0|8TB?c>r\\=rp`pcwP}c\0PP_\\RS\\EPVSy8x`\0?R|NP\tP>}A^VP}Ex\bUZa=syDw}>Ya8wPp[pRnn\brU^dE8U?a\bcW|<FEbbupn^`ZNr\tsof[wA}e{\\z}w[YDQ|dt=wC\tNvbRZ@@U|ZAYpFsabCBB\\`wrqxsYW8uFyWdaWezeUeA_8VoVupv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ZeFc\tovtucxnq|<TnuyXRveYFOegCpAs{YTe|>bE<OXsSqCBWD_SVepfvCCUg]z\tZvQ[\0s|U>pFz\b=OwT``fNJJ:::::R[Q-PR_aVSVPNaR:::::")),J)];function ee(e,t){var n=e.getIssuerHex();if(n===e.getSubjectHex())return e.verifySignature(e.getPublicKey());var i=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n];if(r.getSubjectHex()===e)return r}}(n,t);return!!i&&(!1!==e.verifySignature(i.getPublicKey())&&ee(i,t))}function te(e){return e.getIssuerHex()!==e.getSubjectHex()&&ee(e,$)}!function(e){var t=new Y;"string"==typeof e?t.readCertPEM(e):t.readCertHex(e.hex);var n=te(t);$.push(t)}(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}(":::::ORTV[-PR_aVSVPNaR:::::ZVVTU\tPPONrtNVONtVWNW=_SVw\tVE=ZN=TP`\0T`Vo@Q^ROPbNZVTSZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tR]ZN=TN>bRPtTn?bf?FZ_NQtfQc^^YQNq`gdSp?cyZ^P^fQc^^QQNWQ^aRvZPNTP`\0T`Vo@Q^RWN_fapzFqSFwfbOndSnzyuYz[oaNrS=\bZQNAZaN\\aZ\t[QSnS=\b[aNBZQZ\\aZ\t[QSnZVTaZ^P^fQc^^TRWQawR^ZNATN>bRPNU^zc}nzyg\tR^ZNATN>bROU^zc}nzyg\tRbZOVTN>bRPtYoTyuoz}}f`Bwo?=RQN\\Ot[cONZO>Wyfd\tgdbRaN]Ot[cONZZPRuupz_@feWyZ`bVfWX|gVup[N^xOSugnec|fdyndB{^T}fdB\0ndRf?FZVVPVwN[Otx\0uxvTF=ON^RSNN\\PNtENZVVPPtXPNtRN?=?]q[VD|{\\oyo`oOu}F\tSAe`tn[t\tu\b8^a]qx\bE_^ZN?[QC\0yuOpybY8r\\RPAS=8rUq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pwozwC}xX>C`c]suEdfW?cbeo\b`BbyR@eFTUwSud=t]sS\\onc\tXSq\t{\0DvAVBbnTqEE[QzDyqF`bF}R=Q?VeDo<Vzb\0w}D}NZ\0t}^?OyFP\bVaVNrTNYqe?[NRYTSQby@yzWvT`wQo}y]c_WgxBYCy\tRNRg@NZCaaq8?`\t^`?ryD\t=obzw?E]Ou]n@>bVzqAQT?@_zo@}CxWVTUsAYdNd?{APQr8{P]]AZ>aR\0[D<z?Tr@`u@X|YDwd_<p<>zWE>]\0=X`\b@uucp|^_Qb@uZouTX^o\0\\{PCq{ug8^f[YQAWad8FNqxFQE?ZOo\t}RnO\bsQc\txyccn=nxvs>bDBf\b\bW\\TuTnvAO^U\0QXC>xx8FxRFf<tJ:::::R[Q-PR_aVSVPNaR:::::"));var ne=function(e,t){return ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ne(e,t)};function ie(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var re=function(){return re=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},re.apply(this,arguments)};function oe(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ae,se=(ae="$$FIVE_EVENT$$","undefined"==typeof Symbol?"$Symbol<".concat(ae,">$"):Symbol(ae));function le(e){return e[se]||(e[se]={}),e[se]}var ce=function(){function e(){}return e.prototype.hasListener=function(e){var t=le(this);return t&&t[e]&&t[e].length>0},e.prototype.on=function(e,t,n){var i=this,r=le(this);return r[e]||(r[e]=[]),r[e].push([t,n||!1]),function(){return i.off(e,t)}},e.prototype.once=function(e,t){return this.on(e,t,!0)},e.prototype.off=function(e,t){if(void 0!==e){var n,i=le(this);if(i[e]||(i[e]=[]),void 0!==t){for(var r=0;r<i[e].length&&i[e][r][0]!==t;r++);r<i[e].length&&i[e].splice(r,1)}else i[e].length=0}else(n=this)[se]||delete n[se]},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var i=!1,r=0,o=(le(this)[e]||[]).slice();r<o.length;r++){var a=o[r],s=a[0],l=a[1],c=void 0!==l&&l,u=s.apply(void 0,t);c&&this.off(e,s),!1===u&&(i=!0)}return i},e}();function ue(){}var he="undefined"!=typeof performance&&void 0!==performance.timing?performance.timing.navigationStart:Date.now(),de="undefined"!=typeof performance?function(){return he+performance.now()}:function(){return Date.now()};function pe(e){Object.freeze(e);var t="function"==typeof e,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(e).forEach((function(i){!n.call(e,i)||t&&("caller"===i||"callee"===i||"arguments"===i)||null===e[i]||"object"!=typeof e[i]&&"function"!=typeof e[i]||Object.isFrozen(e[i])||pe(e[i])})),e}var fe=/^([^.]+)(\.([^.]+))*$/;function Ae(e){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(e)}function ve(e,t){return fe.test(e)&&fe.test(t)&&function(e,t){if("*"===e)return!0;var n=e.split(".").reverse(),i=t.split(".").reverse();if(n.length<=1)return e===t;for(var r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0}(e,t)}var me=[/\.([0-9a-z]+)\.jsonp([\?\#].*)?$/i,/jsonp_([0-9a-z]+)([\?\#].*)?$/i],ge=pe(JSON.parse(function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("h/y|pnyu|/9/xr;p|z/9/yvn{wvn;p|z/9/rnyrr;p|z/9/rnyrr;p{/9/rnyrr;w}/9/uv;p|z/9/uv;p{/9/ywpq{;p|z/9/rnyrr:pq{;p|z/9/rnyrr:pq{;p{/9/rnyrr;nv/9/;p{/9/pq{;p{/9/pnyp{|qr;vr/j"))),ye=function(e){function t(t,n,i){return e.call(this,"[NETWORK]: request proxy error(type: ".concat(n,", reason: ").concat(i,"): ").concat(t))||this}return ie(t,e),t}(Error),be=function(e){function t(t,n,i){var r=e.call(this,"[NETWORK]: response error(type: ".concat(n,", status: ").concat(i,"): ").concat(t))||this;return r.httpStatus=i,r}return ie(t,e),t}(Error);!function(e){function t(t,n){return e.call(this,"[NETWORK]: request abort(type: ".concat(n,"): ").concat(t))||this}ie(t,e)}(Error);var xe=function(e){function t(t,n,i){return e.call(this,"[NETWORK]: request timeout(type: ".concat(n,", timeout: ").concat(i,"ms): ").concat(t))||this}return ie(t,e),t}(Error),we=function(e){function t(t,n,i){return e.call(this,"[NETWORK]: request forbidden(type: ".concat(n,", reason: ").concat(i,"): ").concat(t))||this}return ie(t,e),t}(Error);function Me(e){for(var t=0,n=me;t<n.length;t++){var i=n[t],r=e.match(i);if(r)return"jsonp_"+r[1]}return null}function Ce(e){return null!==Me(e)}function Ee(e){var t=e.match(/^([0-9a-z]+\:)\/\/(([^:/?#]*)(?::[0-9]+)?)/);return t?t[1]:location.protocol}function Ie(e){if(/^blob\:/i.test(e))return"blob:";if(/^data\:/i.test(e))return"data:";var t=e.match(/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i);return t?t[2]:location.hostname}var Se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),t}(ce);function Be(e,t,n,i,r){void 0===t&&(t={}),void 0===n&&(n=ue),void 0===i&&(i=ue),void 0===r&&(r=ue);var o=de(),a=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(n){var i,r=Me(e)?"Script":"XMLHttpRequest",o=new ye(a,r,n&&n.message?String(n.message):String(n));return null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,r,"proxy-error",o.message),Promise.reject(o)})).then((function(e){return new Promise((function(s,l){var c,u=t.allowHosts?ge.concat(t.allowHosts):ge.slice(),h=Ie(e),d=Me(e);if(0!==location.hostname.length&&!Ae(location.hostname)&&0===ge.filter((function(e){return ve(e,location.hostname)})).length&&!Ae(h)&&0===u.filter((function(e){return ve(e,h)})).length){var p=d?"Script":"XMLHttpRequest",f=new we(e,p,"request host(".concat(h,") is not allowed"));return i(f),l(f),void(null===(c=t.networkSubscribe)||void 0===c||c.emit("network",e,p,"forbidden",f.message))}if(d){var A=window,v=null,m=!1,g=document.createElement("script");A[d]=function(r){var c,u,h=de(),p=h-o;if(delete A[d],g.parentNode&&g.parentNode.removeChild(g),null!==v&&(window.clearTimeout(v),v=null),!0!==m){if(0!==r.indexOf("data:")){var f=new be(e,"Script",500);return i(f),l(f),void(null===(c=t.networkSubscribe)||void 0===c||c.emit("network",e,"Script","error",f.message))}var y=r.split(","),b=(y[0].match(/:(.*?);/)||[])[1],x=y[1];if("arraybuffer"===t.responseType||"blob"===t.responseType){for(var w=atob(y[1]),M=w.length,C=new Uint8Array(M),E=0;E<M;E++)C[E]=w.charCodeAt(E);x="arraybuffer"===t.responseType?C.buffer:new Blob([C],{type:b})}var I={body:x,meta:{origin:a,source:e,requestTime:o,responseTime:h,costs:p,headers:{}}};n(I),s(I),null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,"Script","ok",JSON.stringify(I.meta)),m=!0}},g.src=e,document.body.appendChild(g),"number"==typeof t.timeout&&(v=window.setTimeout((function(){var n;if(v=null,!0!==m){m=!0;var r=new xe(e,"Script",t.timeout||NaN);i(r),l(r),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Script","timeout",r.message)}}),t.timeout))}else{var y=!1,b=new XMLHttpRequest,x=function(){b&&(b.removeEventListener("timeout",w,!1),b.removeEventListener("progress",M,!1),b.removeEventListener("load",C,!1),b.removeEventListener("error",E,!1)),b=null,x=ue},w=function(){var n;if(!0!==y){y=!0,x();var r=new xe(e,"XMLHttpRequest",t.timeout||NaN);i(r),l(r),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"XMLHttpRequest","timeout",r.message)}},M=function(e){!0!==y&&e.lengthComputable&&(e.total<=0||r(e.loaded/e.total))},C=function(i){var r;if(!0!==y){var l=this.status;if(0===l||l>=200&&l<400){y=!0,x();var c=de(),u=c-o,h=function(e){if(!e)return{};for(var t={},n=e.trim().split("\n"),i=0;i<n.length;i++){var r=n[i],o=r.indexOf(":"),a=r.slice(0,o).trim().toLowerCase(),s=r.slice(o+1).trim();s&&(t[a]?t[a]+=", "+s:t[a]=s)}return t}(this.getAllResponseHeaders()),d=i.total,p={body:this.response,meta:{origin:a,source:e,requestTime:o,responseTime:c,costs:u,headers:h,size:d}};n(p),s(p),null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"XMLHttpRequest","ok",JSON.stringify(p.meta))}else E.call(this)}},E=function(){var n;if(!0!==y){y=!0,x();var r=new be(e,"XMLHttpRequest",this.status);i(r),l(r),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"XMLHttpRequest","error",r.message)}};b.addEventListener("timeout",w,!1),b.addEventListener("progress",M,!1),b.addEventListener("load",C,!1),b.addEventListener("error",E,!1),t.responseType&&(b.responseType=t.responseType),"number"==typeof t.timeout&&(b.timeout=t.timeout),b.open("GET",e,!0),b.send(null)}}))}))}var Te={};function Pe(e,t){void 0===t&&(t={});var n=de(),i=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(n){var r,o=new ye(i,"Link",n&&n.message?String(n.message):String(n));return null===(r=t.networkSubscribe)||void 0===r||r.emit("network",e,"Link","proxy-error",o.message),Promise.reject(o)})).then((function(e){return e in Te?Te[e]:Te[e]=new Promise((function(r,o){var a,s=t.allowHosts?ge.concat(t.allowHosts):ge.slice(),l=Ie(e);if(0!==location.hostname.length&&!Ae(location.hostname)&&0===ge.filter((function(e){return ve(e,location.hostname)})).length&&!Ae(l)&&0===s.filter((function(e){return ve(e,l)})).length){var c=new we(e,"Link","request host(".concat(l,") is not allowed"));return o(c),void(null===(a=t.networkSubscribe)||void 0===a||a.emit("network",e,"Link","forbidden",c.message))}var u=document.createElement("link");u.href=e,u.rel=u.relList&&u.relList.supports("prefetch")?"prefetch":"preload",u.as="fetch",u.crossOrigin="";var h=document.head||document.getElementsByTagName("head")[0];h&&h.appendChild(u);var d=!1;u.onload=function(){var o;if(!0!==d){d=!0,r();var a=de(),s={origin:i,source:e,requestTime:n,responseTime:a,costs:a-n,headers:{}};null===(o=t.networkSubscribe)||void 0===o||o.emit("network",e,"Link","preload",JSON.stringify(s))}},u.onerror=function(n){var i;if(!0!==d){d=!0;var r=new be(e,"Link",0);o(r),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Link","error",r.message)}}}))}))}function Re(e,t,n,i,r,o){void 0===t&&(t={}),void 0===n&&(n=ue),void 0===i&&(i=ue),void 0===r&&(r=ue);var a=de(),s=e;return Promise.resolve().then((function(){return t.requestProxy?t.requestProxy(e):e})).then((function(e){return/^https\:/.test(location.href)&&/^http\:/.test(e)?(console.warn("The page at '".concat(location.href,"' was loaded over HTTPS, but requested an insecure element '").concat(e,"'. This request was automatically upgraded to HTTPS")),e.replace(/^http\:/,"https:")):e})).catch((function(n){var i,r=new ye(s,"Image",n&&n.message?String(n.message):String(n));return null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Image","proxy-error",r.message),Promise.reject(r)})).then((function(e){return new Promise((function(l,c){var u,h=t.allowHosts?ge.concat(t.allowHosts):ge.slice(),d=Ie(e);if(0!==location.hostname.length&&!Ae(location.hostname)&&0===ge.filter((function(e){return ve(e,location.hostname)})).length&&!Ae(d)&&0===h.filter((function(e){return ve(e,d)})).length){var p=new we(e,"Image","request host(".concat(d,") is not allowed"));return i(p),c(p),void(null===(u=t.networkSubscribe)||void 0===u||u.emit("network",e,"Image","forbidden",p.message))}var f=null!=o?o:new Image,A=!1,v=null;"number"==typeof t.timeout&&(v=window.setTimeout((function(){var n;if(f.onload=ue,f.onerror=ue,v=null,!0!==A){A=!0;var r=new xe(e,"Image",t.timeout);i(r),c(r),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Image","timeout",r.message)}}),t.timeout)),f.onload=function(){var i;if(f.onload=ue,f.onerror=ue,null!==v&&(clearTimeout(v),v=null),!0!==A){var o=de();A=!0;var c={body:f,meta:{headers:{},origin:s,source:e,requestTime:a,responseTime:o,costs:o-a}};r(1),n(c),l(c),null===(i=t.networkSubscribe)||void 0===i||i.emit("network",e,"Image","ok",JSON.stringify(c.meta))}},f.onerror=function(){var n;if(f.onload=ue,f.onerror=ue,null!==v&&(clearTimeout(v),v=null),!0!==A){A=!0;var r=new be(e,"Image",0);i(r),c(r),null===(n=t.networkSubscribe)||void 0===n||n.emit("network",e,"Image","ok",r.message)}},r(0),f.src=e}))}))}var Le=function(){if("undefined"!=typeof window){var e=window;return e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(e){return setTimeout(e,16)}}return function(e){return setTimeout(e,16)}}(),Oe=16,Fe=function(){function e(){this.frames=[],this.stoped=!1,this.time=de(),this.context=null,this.loop=this.loop.bind(this),this.loop()}return Object.defineProperty(e,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance},enumerable:!1,configurable:!0}),e.getFrameTime=function(){return Oe},e.prototype.loop=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!this.stoped){var n=de(),i=n-this.time;this.time=n;var r=[];Oe=i;for(var o=0,a=this.frames;o<a.length;o++){var s=a[o];if(s.delay>0)s.delay=s.delay-1;else{try{s.callback.apply(s,oe([n,i],e,!1))}catch(e){console.error(e)}s.once&&r.push(s)}}r.length>0&&(this.frames=this.frames.filter((function(e){return-1===r.indexOf(e)}))),this.requestAnimationFrame(this.loop)}},e.prototype.setContext=function(e){this.cancelAnimationFrame(this.requestId),this.context=e,this.requestId=this.requestAnimationFrame(this.loop)},e.prototype.getContext=function(){return this.context},e.prototype.requestAnimationFrame=function(e){return this.context?this.context.requestAnimationFrame(e):Le(e)},e.prototype.cancelAnimationFrame=function(e){this.context?this.context.cancelAnimationFrame(e):function(e){var t;if("undefined"!=typeof window){var n=window;t=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame||function(e){return window.clearTimeout(e)}}else t=function(e){return window.clearTimeout(e)};t(e)}(this.loop),this.requestId=null},e.prototype.remove=function(e){var t=this.frames.indexOf(e);t>=0&&this.frames.splice(t,1)},e.prototype.add=function(e,t,n,i){var r=this;void 0===t&&(t=!1),void 0===n&&(n=0),void 0===i&&(i=5);var o={callback:e,once:t,delay:n,order:i};return this.frames.push(o),this.frames.sort((function(e,t){return e.order-t.order})),function(){return r.remove(o)}},e.prototype.disponse=function(){this.stoped=!0,this.frames.length=0},e}(),ke={"vrlab-public.ljcdn.com":{type:"tencentCloud",pano:["vrlab-image1.ljcdn.com","vrlab-image2.ljcdn.com"],texture:["vrlab-image3.ljcdn.com"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vrlab-image4.ljcdn.com"]},"vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["vr-image-1.realsee-cdn.cn","vr-image-2.realsee-cdn.cn"],texture:["vr-image-3.realsee-cdn.cn"],tile:["vr-tile-1.realsee-cdn.cn","vr-tile-2.realsee-cdn.cn"],model:["vr-model-1.realsee-cdn.cn","vr-model-2.realsee-cdn.cn"],default:["vr-image-4.realsee-cdn.cn"]},"vr-public.rscdn.cn":{type:"tencentCloud",pano:["vr-image-1.rscdn.cn","vr-image-2.rscdn.cn"],texture:["vr-image-3.rscdn.cn"],tile:["vr-tile-1.rscdn.cn","vr-tile-2.rscdn.cn"],model:["vr-model-1.rscdn.cn","vr-model-2.rscdn.cn"],default:["vr-image-4.rscdn.cn"]},"mars-public.realsee-cdn.cn":{type:"aliyun",pano:["mars-image-1.realsee-cdn.cn","mars-image-2.realsee-cdn.cn"],texture:["mars-image-3.realsee-cdn.cn"],tile:["mars-tile-1.realsee-cdn.cn","mars-tile-2.realsee-cdn.cn"],model:["mars-model-1.realsee-cdn.cn","mars-model-2.realsee-cdn.cn"],default:["mars-image-4.realsee-cdn.cn"]},"global-public.realsee-cdn.com":{type:"tencentCloud",pano:["global-image-1.realsee-cdn.com","global-image-2.realsee-cdn.com"],texture:["global-image-3.realsee-cdn.com"],tile:["global-tile-1.realsee-cdn.com","global-tile-2.realsee-cdn.com"],model:["global-model-1.realsee-cdn.com","global-model-2.realsee-cdn.com"],default:["global-image-4.realsee-cdn.com"]},"earth-ga-public.realsee-cdn.cn":{type:"tencentCloud",pano:["earth-ga-image-1.realsee-cdn.cn","earth-ga-image-2.realsee-cdn.cn"],texture:["earth-ga-image-3.realsee-cdn.cn"],tile:["earth-ga-tile-1.realsee-cdn.cn","earth-ga-tile-2.realsee-cdn.cn"],model:["earth-ga-model-1.realsee-cdn.cn","earth-ga-model-2.realsee-cdn.cn"],default:["earth-ga-image-4.realsee-cdn.cn"]},"test-vr-public.realsee-cdn.com":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],texture:["test-vr-image.realsee-cdn.com"],tile:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],model:["test-vr-image.realsee-cdn.com","test-vr-image.realsee-cdn.com"],default:["test-vr-image.realsee-cdn.com"]},"test-vr-public.realsee-cdn.cn":{type:"tencentCloud",pano:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],texture:["test-vr-image.realsee-cdn.cn"],tile:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],model:["test-vr-image.realsee-cdn.cn","test-vr-image.realsee-cdn.cn"],default:["test-vr-image.realsee-cdn.cn"]}},De=/^https?\:\/\/?([^\/]+)/;function Qe(e,t){return e.replace(De,(function(e,n){return e.slice(0,e.length-n.length)+t}))}var Ne=function(e,t){var n,i=e.split("?")[0],r=i.split(".").pop();if("jpeg"===r&&(r="jpg"),"png"!==r&&"jpg"!==r)return e;var o="";if(void 0!==t.format&&t.format!==r&&(o+="/format/".concat(t.format)),void 0!==t.cut&&(o+="/cut/".concat(t.cut[2],"x").concat(t.cut[3],"x").concat(t.cut[0],"x").concat(t.cut[1])),void 0!==t.quality){var a=null!==(n=t.format)&&void 0!==n?n:r;a&&["jpg","webp","tpg","heif","avif"].indexOf(a)>=0&&(o+="/quality/".concat(t.quality))}if(void 0!==t.size){var s=e.match(/\/cube_(\d+)\//);(s?Number(s[1]):NaN)!==Number(t.size)&&(o+="/thumbnail/".concat(t.size,"x"))}return void 0!==t.sharpen&&(o+="/sharpen/".concat(t.sharpen)),o.length&&(o="?imageMogr2"+o),i+o},Ve=function(e,t){var n,i=e.split("?")[0],r=i.split(".").pop();if("jpeg"===r&&(r="jpg"),"png"!==r&&"jpg"!==r)return e;var o="",a=[],s=t.format,l=t.quality,c=t.size;if(void 0!==s&&s!==r&&a.push("format,".concat("heif"===s?"heic":s)),void 0!==t.cut){var u=t.cut,h=u[0],d=u[1],p=u[2],f=u[3];a.push("crop,x_".concat(h,",y_").concat(d,",w_").concat(p,",h_").concat(f,",g_nw"))}if(void 0!==l&&100!==l){var A=null!==(n=t.format)&&void 0!==n?n:r;A&&["jpg","webp"].indexOf(A)>=0&&a.push("quality,Q_".concat(l))}return c&&2048!==c&&a.push("resize,w_".concat(c)),void 0!==t.sharpen&&a.push("sharpen,".concat(t.sharpen)),a.length&&(o="?x-oss-process=image/"+a.join("/")),i+o};function Ue(e,t){var n=re(re({},ke),t.mappings),i=function(e){var t=e.match(De);return null===t?null:t[1]}(e);if(null===i)return e;var r=n[i];return r?(e=function(e,t,n){var i=t.split("."),r=i[0],o=i.slice(1);if("texture"===r)return Qe(e,n.texture[0]);if("pano"===r||"pano_luminance"===r)switch(o[0],o[1]){case"front":case"left":case"up":return Qe(e,n.pano[0]);case"down":case"right":case"back":return Qe(e,n.pano[1])}else if("pano_tile"===r||"pano_tile_luminance"===r){o[0],o[1];var a=o[2],s=o[3],l=o[4],c=Math.pow(2,Number(a))*Number(s)+Number(l);if(!isNaN(c))return Qe(e,n.tile[c%2])}else if("model"===r){var u=o[0];if(c=Number(u),!isNaN(c))return Qe(e,n.model[c%2])}return Qe(e,n.default[0])}(e,t.key,r),/\.basis(\?|$)/.test(e)&&(e=e.replace(/\.basis(\?|$)/,".jpg$1")),"tencentCloud"===r.type?Ne(e,t):"aliyun"===r.type?Ve(e,t):e):e}function ze(e,t,n){void 0===t&&(t=Ue);var i=t(e,n);if(i===e&&n.cut)throw new Error("ImageURL: cut option not applied.");return i}function qe(e){return new Promise((function(t){var n=new Image,i=setTimeout((function(){n.onload=n.onerror=function(){},clearTimeout(i),t(!1)}));n.onload=n.onerror=function(){n.onload=n.onerror=function(){},clearTimeout(i),t(2===n.height)},n.src=e}))}var He=null;var _e=function(){function e(){this.numPlanes=0,this.clipperPlanes=null,this.clipperFloors=null}return Object.defineProperty(e,"shared",{get:function(){return this.sharedInstance||(this.sharedInstance=new e),this.sharedInstance},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if(this.clipperFloors=[],e instanceof Array){this.clipperPlanes=new Float32Array(24*e.length);for(var n=function(n){var o=[new i.Plane(new i.Vector3(.5,0,0),-1),new i.Plane(new i.Vector3(-.5,0,0),-1),new i.Plane(new i.Vector3(0,.5,0),-1),new i.Plane(new i.Vector3(0,-.5,0),-1),new i.Plane(new i.Vector3(0,0,.5),-1),new i.Plane(new i.Vector3(0,0,-.5),-1)];o.forEach((function(t){t.applyMatrix4(e[n].clippingBoxMatrix)}));for(var a=r.projectPlanes(o,t),s=0;s<24;s++)r.clipperPlanes[24*n+s]=a[s];var l=e[n].hasOwnProperty("floorIndex")?e[n].floorIndex:-1;r.clipperFloors[n]=l},r=this,o=0;o<e.length;o++)n(o)}else{var a=[new i.Plane(new i.Vector3(.5,0,0),-1),new i.Plane(new i.Vector3(-.5,0,0),-1),new i.Plane(new i.Vector3(0,.5,0),-1),new i.Plane(new i.Vector3(0,-.5,0),-1),new i.Plane(new i.Vector3(0,0,.5),-1),new i.Plane(new i.Vector3(0,0,-.5),-1)];a.forEach((function(t){t.applyMatrix4(e.clippingBoxMatrix)})),this.clipperPlanes=this.projectPlanes(a,t),this.clipperFloors[0]=e.hasOwnProperty("floorIndex")?e.floorIndex:-1}},e.prototype.projectPlanes=function(e,t){var n=null!==e?e.length:0,r=4*n,o=t.matrixWorldInverse,a=new i.Matrix3;a.getNormalMatrix(o);for(var s=new Float32Array(r),l=new i.Plane,c=0,u=0;c!==n;++c,u+=4)l.copy(e[c]).applyMatrix4(o,a),l.normal.toArray(s,u),s[u+3]=l.constant;return s},e}(),je=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t.needsRender=!0,t}return ie(t,e),t}(i.Mesh),Ke=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.needsRender=!0,t.enableTransparent=!1,t}return ie(t,e),t.prototype.getTransparent=function(){return this.enableTransparent},t.prototype.setTransparent=function(e){this.enableTransparent!==e&&(this.enableTransparent=e,this.traverse((function(t){t instanceof je&&t.material.forEach((function(t){t.transparent=e}))})))},t.prototype.getMaterial=function(){var e=null;return this.traverse((function(t){if(null===e&&t instanceof je){var n=t.material[0];e={pano0:n.pano0,pano1:n.pano1,modelAlpha:n.modelAlpha,progress:n.progress,useBlackTransition:n.useBlackTransition,modelColorInfo:n.modelColorInfo,opacity:n.opacity,floorIndex:n.floorIndex,floorInfo:n.floorInfo,clippers:n.clippers,clipperPlanesArray:n.clipperPlanesArray,clipperFloors:n.clipperFloors,globalFloorInfo:n.globalFloorInfo}}})),e},t.prototype.setMaterial=function(e){this.traverse((function(t){t instanceof je&&t.material.forEach((function(t){void 0!==e.pano0&&(t.pano0=e.pano0),void 0!==e.pano1&&(t.pano1=e.pano1),void 0!==e.modelAlpha&&(t.modelAlpha=e.modelAlpha),void 0!==e.progress&&(t.progress=e.progress),void 0!==e.useBlackTransition&&(t.useBlackTransition=e.useBlackTransition),void 0!==e.modelColorInfo&&(t.modelColorInfo=e.modelColorInfo),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.floorIndex&&(t.floorIndex=e.floorIndex),void 0!==e.floorInfo&&(t.floorInfo=e.floorInfo),void 0!==e.clippers&&(t.clippers=e.clippers),void 0!==e.clipperPlanesArray&&(t.clipperPlanesArray=e.clipperPlanesArray),void 0!==e.clipperFloors&&(t.clipperFloors=e.clipperFloors),void 0!==e.globalFloorInfo&&(t.globalFloorInfo=e.globalFloorInfo)}))}))},t.prototype.disposeMaterial=function(){this.traverse((function(e){if(e instanceof je){var t=[];e.material.forEach((function(e){var n=e.uniforms;Object.keys(n).map((function(e){if(/^pano\d\_/.test(e))n[e].value=null;else{var i=n[e].value;i&&"function"==typeof i.dispose&&-1===t.indexOf(i)&&(n[e].value=null,t.push(i))}})),e.dispose()})),t.forEach((function(e){return e.dispose()}))}}))},t.prototype.disposeGeometry=function(){this.traverse((function(e){e instanceof je&&e.geometry.dispose()}))},t}(i.Group),Ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.floorIndex=0,t}return ie(t,e),t}(Ke),We=["right","left","up","down","front","back"];function Xe(e,t,n,r){var o=new i.Box3;switch(e){case"up":o.min.y=.5,o.max.y=.5,o.min.x=+t-.5,o.max.x=+t-.5+r,o.min.z=.5-n-r,o.max.z=.5-n;break;case"down":o.min.y=-.5,o.max.y=-.5,o.min.x=+t-.5,o.max.x=+t-.5+r,o.min.z=+n-.5,o.max.z=+n-.5+r;break;case"left":o.min.x=-.5,o.max.x=-.5,o.min.z=.5-t-r,o.max.z=.5-t,o.min.y=.5-n-r,o.max.y=.5-n;break;case"right":o.min.x=.5,o.max.x=.5,o.min.z=+t-.5,o.max.z=+t-.5+r,o.min.y=.5-n-r,o.max.y=.5-n;break;case"front":o.min.z=-.5,o.max.z=-.5,o.min.x=+t-.5,o.max.x=+t-.5+r,o.min.y=.5-n-r,o.max.y=.5-n;break;case"back":o.min.z=.5,o.max.z=.5,o.min.x=.5-t-r,o.max.x=.5-t,o.min.y=.5-n-r,o.max.y=.5-n}return o.applyMatrix4((new i.Matrix4).makeRotationY(Math.PI))}var Ye=function(e,t){if(!(e.level>=t))for(var n=e.level+1,r=e.size/2,o=0,a=[new i.Vector2(e.position.x,e.position.y),new i.Vector2(e.position.x+r,e.position.y),new i.Vector2(e.position.x,e.position.y+r),new i.Vector2(e.position.x+r,e.position.y+r)];o<a.length;o++){var s=a[o],l={face:e.face,level:n,size:r,position:s,box:Xe(e.face,s.x,s.y,r),children:[]};e.children.push(l),Ye(l,t)}};function Ze(e){var t=We.map((function(t){return function(e,t){var n={level:0,face:e,position:new i.Vector2(0,0),size:1,box:Xe(e,0,0,1),children:[]};return Ye(n,t),n}(t,e)}));return{children:t}}function Je(e,t){for(var n=0,i=e.children;n<i.length;n++){var r=i[n];!1!==t(r)&&Je(r,t)}}var $e=new i.BoxBufferGeometry(1,1,1,1,1);$e.deleteAttribute("uv"),$e.deleteAttribute("normal"),$e.groups=[],$e.scale(-1,1,1);var et=new i.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\nvarying vec3 worldPosition;\nvoid main() {\n vec4 transform = vec4(position, 1.0);\n worldPosition = (modelMatrix * transform).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * transform;\n}\n",fragmentShader:"\nuniform samplerCube map;\nvarying vec3 worldPosition;\nvoid main() {\n gl_FragColor = textureCube(map, worldPosition);\n}\n",depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:i.NoBlending,lights:!1,toneMapped:!1,fog:!1}),tt=new i.Scene;tt.matrixAutoUpdate=!1;var nt,it=new i.Mesh($e,et);function rt(e,t,n){et.uniforms.map.value=e;var r=n.autoClear;n.autoClear=!1;var o=new i.CubeCamera(.1,2,t);o.matrixAutoUpdate=!1,o.update(n,tt),n.autoClear=r,et.uniforms.map.value=null}it.matrixAutoUpdate=!1,tt.add(it);var ot=null!==(nt=Math.SQRT1_2)&&void 0!==nt?nt:Math.sqrt(2),at={up:new i.Quaternion(ot,0,0,ot),down:new i.Quaternion(-ot,0,0,ot),left:new i.Quaternion(0,ot,0,ot),right:new i.Quaternion(0,-ot,0,ot),front:new i.Quaternion(0,0,0,1),back:new i.Quaternion(0,1,0,0)},st=function(){var e=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),t=new Float32Array([0,0,1,0,0,1,1,1]),n=new Uint8Array([0,1,2,1,3,2]),r=new i.BufferGeometry;return r.setAttribute("position",new i.BufferAttribute(e,3)),r.setAttribute("uv",new i.BufferAttribute(t,2)),r.setIndex(new i.BufferAttribute(n,1)),r}(),lt="\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",ct="\nuniform sampler2D map;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(map, vUv);\n}\n",ut=[];function ht(e){e.uniforms.map.value=null,ut.push(e)}var dt=[];function pt(){var e=this.src;this.onerror=this.onload=ue,this.removeAttribute("src"),/^blob\:/.test(e)&&URL.revokeObjectURL(e),this.close=ue}var ft=[],At=0;function vt(){var e=document.createElementNS("http://www.w3.org/1999/xhtml","img");return Object.assign(e,{crossOrigin:"",close:pt})}function mt(){return new Promise((function(e){At>0?(At--,e(vt())):ft.push((function(){e(vt())}))}))}function gt(){dt.push(this)}function yt(e){return new Promise((function(t,n){var i=vt();i.onload=function(){i.onload=i.onerror=ue,setTimeout((function(){t(i)}),0)},i.onerror=function(){var e=i.src;i.onload=i.onerror=ue,i.close(),n(new Error("image load error: ".concat(e)))},i.src=URL.createObjectURL(e)}))}function bt(e,t){if(t&&(e.width>t.width||e.height>t.height)){var n=function(e,t){var n=dt.shift();if(n)return n.width=e,n.height=t,n;var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return Object.assign(i,{close:gt})}(Math.min(e.width,t.width),Math.min(e.height,t.height)),r=n.getContext("2d");r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,n.width,n.height),e.close();var o=new i.Texture(n);o.needsUpdate=!0,o.flipY=!0;var a=o.dispose;return o.dispose=function(){n.close(),a.call(o),o.dispose=a},o}var s=new i.Texture(e);s.needsUpdate=!0,s.flipY=!0;var l=s.dispose;return s.dispose=function(){e.close(),l.call(s),s.dispose=l},s}Fe.shared.add((function(){if(At=10,ft.length)for(var e=0,t=ft.splice(0,At);e<t.length;e++){var n=t[e];At--,n()}}));var xt=["right","left","up","down","front","back"],wt=function(){function e(e,t,n,i,r){this.tileTree=t,this.tileSources=n,this.options=i,this.renderer=r,this.name="",this.needsRender=!1,this.disposed=!1,this.loadedCubeNodes=new Set,this.loadingCubeNodes=new Set,this.baseCubeTexture=null,this._cubeRenderTarget=null,this.textures=[],this.baseCubeTexture=e}return Object.defineProperty(e.prototype,"cubeRenderTarget",{get:function(){return this._cubeRenderTarget},set:function(e){var t,n,r,o,a;if(null===e)throw new Error("cannot set cubeRenderTarget to null.");e.width!==this.options.textureSize&&e.setSize(this.options.textureSize,this.options.textureSize),e.texture.format=null!==(t=this.options.format)&&void 0!==t?t:i.RGBAFormat,e.texture.minFilter=null!==(n=this.options.minFilter)&&void 0!==n?n:i.LinearFilter,e.texture.magFilter=null!==(r=this.options.magFilter)&&void 0!==r?r:i.LinearFilter,e.texture.wrapS=null!==(o=this.options.wrapS)&&void 0!==o?o:i.ClampToEdgeWrapping,e.texture.wrapT=null!==(a=this.options.wrapT)&&void 0!==a?a:i.ClampToEdgeWrapping,this.baseCubeTexture&&(rt(this.baseCubeTexture,e,this.renderer),this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this._cubeRenderTarget&&rt(this._cubeRenderTarget.texture,e,this.renderer),this._cubeRenderTarget=e},enumerable:!1,configurable:!0}),e.prototype.requestTile=function(e){var t,n,r,o,a,s,l=this,c=this.tileSources.filter((function(t){return t.level===e.level}))[0];if(c){var u=c.size,h=Math.pow(2,e.level)*e.position.y,d=Math.pow(2,e.level)*e.position.x,p="".concat((null!==(r=null===(n=null===(t=this.options.imageURL)||void 0===t?void 0:t.options)||void 0===n?void 0:n.key)&&void 0!==r?r:"pano.0").replace(/^pano/,"pano_tile"),".").concat(e.face,".").concat(e.level,".").concat(h,".").concat(d),f=re(re({},null!==(a=null===(o=this.options.imageURL)||void 0===o?void 0:o.options)&&void 0!==a?a:{key:"unknown"}),{key:p,size:u*e.size===this.options.tileImageSize?void 0:this.options.tileImageSize,quality:void 0,cut:[u*e.position.x,u*e.position.y,u*e.size,u*e.size]});this.loadingCubeNodes.add(e),this.options.textureLoader.loadTexture(c[e.face],{imageURL:{transform:null===(s=this.options.imageURL)||void 0===s?void 0:s.transform,options:re({},f)},format:i.RGBAFormat,viaAjax:!1}).then((function(t){l.disposed?t.body.dispose():(l.textures.push({face:e.face,level:e.level,position:e.position,size:new i.Vector2(e.size,e.size),texture:t.body}),l.loadedCubeNodes.add(e))})).catch(ue).then((function(){l.disposed||l.loadingCubeNodes.delete(e)}))}else this.loadedCubeNodes.add(e)},e.prototype.update=function(e,t){var n=this;if(!this.disposed){var r=[];Je(this.tileTree,(function(i){return!n.loadingCubeNodes.has(i)&&(!(i.level>t)&&(!!e.intersectsBox(i.box)&&(n.loadedCubeNodes.has(i)?void 0:(r.push(i),!1))))}));for(var o=0,a=r;o<a.length;o++){var s=a[o];this.requestTile(s)}if(this.cubeRenderTarget&&this.textures.length){var l=this.textures.splice(0,4);!function(e,t,n){var r=new i.Scene,o=new i.Group;o.scale.set(1,1,-1),r.add(o);for(var a=[],s=0,l=e;s<l.length;s++){var c=l[s],u=ut.pop()||new i.ShaderMaterial({uniforms:{map:{value:null}},vertexShader:lt,fragmentShader:ct,depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:i.NoBlending,lights:!1,toneMapped:!1,fog:!1});a.push(u),u.uniforms.map.value=c.texture;var h=new i.Group,d=new i.Mesh(st,u);d.position.set(c.position.x+c.size.x/2-.5,1-(c.position.y+c.size.y/2)-.5,-.5),d.scale.set(c.size.x,c.size.y,1),h.quaternion.copy(at[c.face]),h.add(d),o.add(h)}var p=n.autoClear;n.autoClear=!1;var f=new i.CubeCamera(.1,2,t);f.matrixAutoUpdate=!1,f.update(n,r),n.autoClear=p;for(var A=0,v=a;A<v.length;A++)ht(u=v[A])}(l,this.cubeRenderTarget,this.renderer),this.needsRender=!0;for(var c=0,u=l;c<u.length;c++){u[c].texture.dispose()}}}},Object.defineProperty(e.prototype,"tilePending",{get:function(){return this.loadingCubeNodes.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){if(!this._cubeRenderTarget)throw new Error("cubeRenderTarget never set.");return this._cubeRenderTarget.texture},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){if(!this.disposed){this.disposed=!0,this.baseCubeTexture&&(this.baseCubeTexture.dispose(),this.baseCubeTexture=null),this.loadingCubeNodes.clear(),this.loadedCubeNodes.clear();for(var e=0,t=this.textures;e<t.length;e++){t[e].texture.dispose()}this.textures.length=0}},e}(),Mt=function(){function e(e){this.timeout=e.timeout,this.allowHosts=e.allowHosts,this.requestProxy=e.requestProxy,this.networkSubscribe=e.networkSubscribe}return e.prototype.setAllowHosts=function(e){this.allowHosts=e},e.prototype.setRequestProxy=function(e){this.requestProxy=e},e.prototype.setNetworkSubscribe=function(e){this.networkSubscribe=e},e.prototype.loadTexture=function(e,t,n,i,r,o){var a,s,l,c;void 0===t&&(t={}),void 0===n&&(n=ue),void 0===i&&(i=ue),void 0===r&&(r=ue);var u={};void 0!==t.flipY&&(u.flipY=t.flipY),void 0!==t.format&&(u.format=t.format),void 0!==t.minFilter&&(u.minFilter=t.minFilter),void 0!==t.magFilter&&(u.magFilter=t.magFilter);var h=null!==(s=null===(a=t.imageURL)||void 0===a?void 0:a.options)&&void 0!==s?s:{key:"unknown"},d=Ee(e=ze(e,null===(l=t.imageURL)||void 0===l?void 0:l.transform,h)),p={timeout:this.timeout,allowHosts:this.allowHosts,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe},f=null!==(c=t.viaAjax)&&void 0!==c&&c,A=Ce(e),v=/^https?:/.test(d);if(A?f=!0:v||(f=!1),f){return Be(e,re(re({},p),{responseType:"blob"}),void 0,void 0,r).then((function(e){return yt(e.body)})).then((function(e){return bt(e,t.maxSize)})).then((function(e){return Object.assign(e,u),e})).then((function(e){var t={meta:null,body:e};return n(t),t})).catch((function(e){return i(e),Promise.reject(e)}))}var m,g=null;return Promise.resolve().then((function(){return mt()})).then((function(t){return m=t,Re(e,p,void 0,void 0,r,t)})).then((function(e){return g=e.meta,bt(e.body,t.maxSize)})).then((function(e){return Object.assign(e,u),e})).then((function(e){var t={meta:g,body:e};return n(t),t})).catch((function(e){return m&&m.close(),i(e),Promise.reject(e)}))},e.prototype.loadCubeTexture=function(e,t,n,r,o,a){var s,l,c,u;void 0===t&&(t={}),void 0===n&&(n=ue),void 0===r&&(r=ue),void 0===o&&(o=ue),void 0!==t.format&&t.format,void 0!==t.minFilter&&t.minFilter,void 0!==t.magFilter&&t.magFilter;for(var h=[e[xt[0]],e[xt[1]],e[xt[2]],e[xt[3]],e[xt[4]],e[xt[5]]],d={timeout:this.timeout,allowHosts:this.allowHosts,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe},p=[],f=[0,0,0,0,0,0],A=[],v=function(e){var n=null!==(l=null===(s=t.imageURL)||void 0===s?void 0:s.options)&&void 0!==l?l:{key:"unknown"},i=ze(h[e],null===(c=t.imageURL)||void 0===c?void 0:c.transform,re(re({},n),{key:n.key+"."+xt[e]})),r=Ee(i),a=function(t){f[e]=t,o(f.reduce((function(e,t){return e+t}),0)/6)},v=null!==(u=t.viaAjax)&&void 0!==u&&u,m=/^https?:$/.test(r);if(Ce(i)?v=!0:m||(v=!1),v){var g=Be(i,re(re({},d),{responseType:"blob"}),void 0,void 0,a).then((function(t){return A[e]=t.meta,yt(t.body)}));p.push(g)}else{var y;g=Promise.resolve().then((function(){return mt()})).then((function(e){return y=e,Re(i,d,void 0,void 0,a,e)})).then((function(t){return A[e]=t.meta,t.body})).catch((function(e){return y&&y.close(),Promise.reject(e)}));p.push(g)}},m=0;m<6;m++)v(m);return Promise.all(p).then((function(e){return function(e){var t=new i.CubeTexture(e);t.needsUpdate=!0,t.flipY=!1;var n=t.dispose;return t.dispose=function(){for(var i=0,r=e;i<r.length;i++)r[i].close();n.call(t),t.dispose=n},t}(e)})).then((function(e){return Object.assign(e,re({encoding:i.sRGBEncoding},t)),e})).then((function(e){var t={body:e,meta:A};return n(t),t})).catch((function(e){for(var t=0,n=p;t<n.length;t++){n[t].then((function(e){return e.close()})).catch(ue)}return r(e),Promise.reject(e)}))},e.prototype.loadTiledCubeTexture=function(e,t,n,r,o,a,s){var l=this;return void 0===n&&(n={}),void 0===r&&(r=ue),void 0===o&&(o=ue),void 0===a&&(a=ue),new Promise((function(c,u){var h,d;l.loadCubeTexture(e,{imageURL:{transform:null===(h=n.imageURL)||void 0===h?void 0:h.transform,options:null===(d=n.imageURL)||void 0===d?void 0:d.options},format:i.RGBAFormat,viaAjax:n.viaAjax},(function(e){var i,o,a=e.meta,u=e.body,h=null!==(i=n.tileImageSize)&&void 0!==i?i:512,d=null!==(o=n.tileMaxLevel)&&void 0!==o?o:2,p=Math.max(1024*d,512),f=Ze(d),A={meta:a,body:new wt(u,f,t,{textureSize:p,tileImageSize:h,textureLoader:l,imageURL:n.imageURL},s)};r(A),c(A)}),(function(e){o(e),u(e)}),a,s).catch(ue)}))},e}(),Ct=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("n\bv{t-rp@-[|znyHn\bv{t-rp@-cvr]|vv|{Hn\bv{t-rpA-|yq]|vv|{H0v{pyqr-Ip|zz|{K0v{pyqr-Il}nlrrK0v{pyqr-I?l}nlrrK0v{pyqr-Ip|y|l}nlrrK0v{pyqr-Iunq|zn}l}nlrrK|vq-znv{56-\n--0v{pyqr-IlrrK--0v{pyqr-I?lrrK--0v{pyqr-Ip|y|lrrK--0v{pyqr-Iortv{{|znylrrK--0v{pyqr-Iqrsny{|znylrrK--rpA-n{s|zrq-J-rpA5}|vv|{9->;=6H--rpA-z]|vv|{-J-z|qrycvrZnv-7-n{s|zrqH--[|zny-J-{|znyv\tr5n{s|zrq[|zny6H--cvr]|vv|{-J-:z]|vv|{;\b\tH--|yq]|vv|{-J-z|qryZnv-7-n{s|zrqH--tyl]|vv|{-J-}|wrpv|{Znv-7-z|qrycvrZnv-7-n{s|zrqH--0v{pyqr-Iunq|zn}lrrK\f"),Et=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("0qrsv{r-OYNPXlP\\Y\\_-rpA5=;=EC9-=;>=C9-=;>AF9->;=60qrsv{r-aNb-C;?E@>EB?{vs|z-nz}yrPor-}n{|=lzn}H{vs|z-znA-}n{|=lznvH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|=lyzv{n{prZn}H0r{qvs{vs|z-nz}yrPor-}n{|>lzn}H{vs|z-znA-}n{|>lznvH0vs-qrsv{rq5b`RlYbZV[N[PR6--{vs|z-nz}yrPor-}n{|>lyzv{n{prZn}H0r{qvs{vs|z-rp@-qvssrH{vs|z-rp@-rzvvrH{vs|z-rp@-}rpynH{vs|z-sy|n-uv{v{rH{vs|z-sy|n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;\t6H--r{-rp?5=;B-8-}uv-<-aNb9-urn-<-]V6H\f|vq-znv{56-\n--0vs-qrsv{rq5b`RlNYYlP\\Y\\_6----tylSntP|y|-J-rpA5z|qryP|y|V{s|;9z|qryP|y|V{s|;t9z|qryP|y|V{s|;o9>;=6H----r{H--0r{qvsvs-5q|5cvr]|vv|{9-[|zny6-I-=;=6-\n----qvpnqH--\f--<<前置裁切计算------0vs-qrsv{rq5b`RlPbaR_6----rpA-}yn{rH-------s|5-v{-v-J-=H-v-I-[bZlPYV]]V[TlO\\eH-v886\n------o||y-pyv}}rq-J-rH------v{-pr{Sy||V{qr-J-v{5pyv}}rSy||hvj6H------<<内部展开s|循环,让v{q|能用------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8->6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-?6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-@6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-A6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------------}yn{r-J-rr?Q5pyv}}r]yn{rarr9-rp?55sy|n5v-7-C-8-B6-8-=;B6-<-sy|n5[bZlPYV]]V[TlN__NflYR[TaU69-=;B6-6H------pyv}}rq-J-5-q|5-cvr]|vv|{9-}yn{r;\b\t-6-K-}yn{r;-6-33-pyv}}rqH------rp?-sy||bH------sy||b;-J-sy|n5pr{Sy||V{qr6-<-sy|n5[bZlSY\\\\_lP\\b[a6H------sy||b;\b-J-=;BH------rpA-lsy||V{s|H------lsy||V{s|-J-rr?Q5ty|onySy||V{s|arr9-sy||b6H------------o||y-v{antrSy||-J-|yq]|vv|{;\b-I-lsy||V{s|;-33-|yq]|vv|{;\b-K-lsy||V{s|;tH------pyv}}rq-J-5pr{Sy||V{qr-JJ-:>-\v\v-v{antrSy||6-33-pyv}}rqH------vs5pyv}}rq6-\n--------qvpnqH------\f----\f--0r{qvs--<<楼层切割计算--0vs-qrsv{rq5b`RlPYV]SY\\\\_6----vs-5|yq]|vv|{;\b-I-sy||V{s|;-\v\v-|yq]|vv|{;\b-K-sy||V{s|;t6-\n------qvpnqH----\f--0r{qvs--rpA-qvssrP|y|-J-rpA5qvssr;to9-|}npv\b6H--_rsyrprqYvtu-rsyrprqYvtu-J-_rsyrprqYvtu5rp@5=;=69-rp@5=;=69-rp@5=;=69-rp@5=;=66H--rp@-|nyRzvvr_nqvn{pr-J-rzvvrH--0v{pyqr-Izn}lsntzr{K--0v{pyqr-Ip|y|lsntzr{K--0v{pyqr-Iny}unzn}lsntzr{K--0v{pyqr-Iny}unrlsntzr{K--0v{pyqr-I}rpynzn}lsntzr{K--0v{pyqr-I{|znylsntzr{lortv{K--0v{pyqr-I{|znylsntzr{lzn}K--0v{pyqr-Irzvvrzn}lsntzr{K--0v{pyqr-Iyvtul}u|{tlsntzr{K--0v{pyqr-Iyvtulsntzr{lortv{K--<<-调整曝光值--vnqvn{pr-J-vnqvn{pr-7-r}|rH--0v{pyqr-Iyvtulsntzr{lzn}K--0v{pyqr-Iyvtulsntzr{lr{qK--0v{pyqr-In|zn}lsntzr{K--<<-减少方向光对模型的影响--rp@-|t|v{tYvtu-J-5rsyrprqYvtu;qvrpQvssr-7-=;?6-8----rsyrprqYvtu;v{qvrpQvssr-8----rsyrprqYvtu;v{qvrp`}rpyn-8----|nyRzvvr_nqvn{prH--<<-修复黑色面片的问题--vs-5|t|v{tYvtu;-K-=;=-\v\v-|t|v{tYvtu;t-K-=;=-\v\v-|t|v{tYvtu;o-K-=;=6-\n----tylSntP|y|-J-rpA5|t|v{tYvtu9-qvssrP|y|;n6H--\f-ryr-\n----tylSntP|y|-J-rpA5OYNPXlP\\Y\\_;\b\t9-qvssrP|y|;n6H--\f--rp@-}n{|=a|crr-J-5|yq]|vv|{;\b\t-:-}n{|=lznvh@j;\b\t6-7-zn@5}n{|=lznv6H--rp@-}n{|>a|crr-J-5|yq]|vv|{;\b\t-:-}n{|>lznvh@j;\b\t6-7-zn@5}n{|>lznv6H--rpA-}n{|P|y|H--rpA-}n{|=P|y|-J-rrPor5}n{|=lzn}9-}n{|=a|crr6H--rpA-}n{|>P|y|-J-rrPor5}n{|>lzn}9-}n{|>a|crr6H--0vs-qrsv{rq5b`RlYbZV[N[PR6----}n{|=P|y|;n-J->;=-:-rrPor5}n{|=lyzv{n{prZn}9-}n{|=a|crr6;H----}n{|>P|y|;n-J->;=-:-rrPor5}n{|>lyzv{n{prZn}9-}n{|>a|crr6;H--0r{qvs--0vs-qrsv{rq5b`RlOYNPXla_N[`VaV\\[6----sy|n-oynpx]|tr-J-np|5:?;=-7-}|tr-8->;=6H----}n{|P|y|-J-zv5}n{|=P|y|9-OYNPXlP\\Y\\_9-zv{5>;=9-oynpx]|tr66H----}n{|P|y|-J-zv5}n{|P|y|9-}n{|>P|y|9-zn5=;=9-oynpx]|tr-:-?;=66H--0ryr----}n{|P|y|-J-zv5}n{|=P|y|9-}n{|>P|y|9-}|tr6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\lcVQR\\6----rp@-pnzrna|crr-J-|yq]|vv|{;\b\t-:-pnzrn]|vv|{H----rpA-zn}P||q-J-rpA5pnzrna|crr9->;=6-7-}n{|cvqr|lznvH----rp?--J-rp?5------=;B-8-zn}P||q;-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;9------=;B-:-zn}P||q;\b-<-zn}P||q;\t-<-}n{|cvqr|lv\tr;\b----6H----rpA-vqr|P|y|-J-rr?Q5}n{|cvqr|lzn}9-6H----sy|n-znpu-J-5>;=-:-r}5=;=9-zn}P||q;\t66-7-5>;=-:-r}5=;B9-no5;-:-=;B666-7-5>;=-:-r}5=;B9-no5;\b-:-=;B666H----sy|n-ny}un-J-pynz}5=;=9->;=9-B;=-7-5>;=-:-pynz}5qvn{pr59-rp?5=;B9-=;B66-<-=;BB-9-=;=9->;=666H----}n{|P|y|-J-zv5}n{|P|y|9-vqr|P|y|9-znpu-7-ny}un-7-}n{|cvqr|lny}un6H--0r{qvs--0vs-qrsv{rq5b`Rl]N[\\l\\]NPVaf6----tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H----tylSntP|y|;n-J-|}npv\bH--0ryr----tylSntP|y|-J-rpA5tylSntP|y|;to9-|}npv\b6H----tylSntP|y|-J-zv5}n{|P|y|9-tylSntP|y|9-z|qryNy}un6H--0r{qvs\f"),It=new i.WebGLCubeRenderTarget(1).texture;It.name="EMPTY_TEXTURE";var St=Object.assign({modelAlpha:new i.Uniform(0),progress:new i.Uniform(0),pano0_map:new i.Uniform(It),pano0_luminanceMap:new i.Uniform(null),pano0_matrix:new i.Uniform(new i.Matrix4),pano1_map:new i.Uniform(It),pano1_luminanceMap:new i.Uniform(null),pano1_matrix:new i.Uniform(new i.Matrix4),floorIndex:new i.Uniform(-1),floorInfo:new i.Uniform(null),clipperPlanesArray:new i.Uniform(new Float32Array),clipperPlanesTexture:new i.Uniform(null),clipperFloors:new i.Uniform([]),modelColorInfo:new i.Uniform(null),globalFloorInfo:new i.Uniform([]),globalFloorInfoTexture:new i.Uniform(null)},{exposure:new i.Uniform(1),emissive:new i.Uniform(new i.Color(0)),emissiveMap:new i.Uniform(null),specular:new i.Uniform(new i.Color(1118481)),specularMap:new i.Uniform(null),normalMap:new i.Uniform(null),bumpMap:new i.Uniform(null),shininess:new i.Uniform(30)},i.UniformsUtils.clone(i.UniformsLib.common),i.UniformsUtils.clone(i.UniformsLib.lights)),Bt=function(e){function t(t){void 0===t&&(t={});var n,r,o,a,s,l,c,u,h,d=this;d=e.call(this,{vertexShader:Ct,fragmentShader:Et,uniforms:i.UniformsUtils.clone(St),defines:{USE_MAP:!0,USE_UV:!0,USE_LUMINANCE:!1,USE_PANO_OPACITY:!1,USE_BLACK_TRANSITION:!1,USE_PANO_VIDEO:!1,USE_ALL_COLOR:!1,USE_CLIPFLOOR:!1,USE_CUTER:!1,NUM_FLOOR_COUNT:0,NUM_CLIPPING_ARRAY_LENGTH:0,NUM_CLIPPING_BOX:0},blending:i.NoBlending,lights:!0})||this;var p=null,f=null;return Object.defineProperties(d,{pano0:{get:function(){return p},set:function(e){p=e,null===e?(this.uniforms.pano0_map.value=It,this.uniforms.pano0_luminanceMap.value=null,this.uniforms.pano0_matrix.value.identity()):(this.uniforms.pano0_map.value=e.map instanceof wt?e.map.texture:e.map,this.uniforms.pano0_luminanceMap.value=e.luminanceMap instanceof wt?e.luminanceMap.texture:e.luminanceMap,this.uniforms.pano0_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}},pano1:{get:function(){return f},set:function(e){f=e,null===e?(this.uniforms.pano1_map.value=It,this.uniforms.pano1_luminanceMap.value=null,this.uniforms.pano1_matrix.value.identity()):(this.uniforms.pano1_map.value=e.map instanceof wt?e.map.texture:e.map,this.uniforms.pano1_luminanceMap.value=e.luminanceMap instanceof wt?e.luminanceMap.texture:e.luminanceMap,this.uniforms.pano1_matrix.value.copy(e.matrix));var t=null!==this.uniforms.pano0_luminanceMap.value&&null!==this.uniforms.pano1_luminanceMap.value;this.defines.USE_LUMINANCE!==t&&(this.defines.USE_LUMINANCE=t,this.needsUpdate=!0)}},modelAlpha:{get:function(){return this.uniforms.modelAlpha.value},set:function(e){this.uniforms.modelAlpha.value=e}},progress:{get:function(){return this.uniforms.progress.value},set:function(e){this.uniforms.progress.value=e}},useBlackTransition:{get:function(){return this.defines.USE_BLACK_TRANSITION},set:function(e){this.defines.USE_BLACK_TRANSITION!==e&&(this.defines.USE_BLACK_TRANSITION=e,this.needsUpdate=!0)}},modelColorInfo:{get:function(){return this.uniforms.modelColorInfo.value},set:function(e){this.uniforms.modelColorInfo.value=e;var t=null!==e;this.defines.USE_ALL_COLOR!==t&&(this.defines.USE_ALL_COLOR=t,this.needsUpdate=!0)}},opacity:{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e;var t=e<1?i.NormalBlending:i.NoBlending;t!==this.blending&&(this.blending=t,this.needsUpdate=!0)}},floorIndex:{get:function(){return this.uniforms.floorIndex.value},set:function(e){this.uniforms.floorIndex.value=e}},floorInfo:{get:function(){return this.uniforms.floorInfo.value},set:function(e){var t,n=this.defines.USE_CLIPFLOOR;e&&!e.equals(new i.Vector3(0,0,0))?(t=!0,this.uniforms.floorInfo.value=e):(t=!1,this.uniforms.floorInfo.value=null),n!==t&&(this.defines.USE_CLIPFLOOR=t,this.needsUpdate=!0)}},clippers:{get:function(){return this._clippers},set:function(e){this._clippers=e}},clipperPlanesArray:{get:function(){return this.uniforms.clipperPlanesArray.value},set:function(e){var t=!1;if(e instanceof Float32Array&&e.length>0&&e.length%6==0){var n=e.length/4;!0!==this.defines.USE_CUTER&&(this.defines.USE_CUTER=!0,t=!0),this.defines.NUM_CLIPPING_ARRAY_LENGTH!==n&&(this.defines.NUM_CLIPPING_ARRAY_LENGTH=n,t=!0),this.defines.NUM_CLIPPING_BOX!==n/6&&(this.defines.NUM_CLIPPING_BOX=n/6,t=!0),this.uniforms.clipperPlanesArray.value=e;var r=new i.DataTexture(e,n,1,i.RGBAFormat,i.FloatType);r.wrapS=i.ClampToEdgeWrapping,r.wrapT=i.ClampToEdgeWrapping,r.minFilter=i.NearestFilter,r.magFilter=i.NearestFilter,this.uniforms.clipperPlanesTexture.value&&this.uniforms.clipperPlanesTexture.value.dispose(),this.uniforms.clipperPlanesTexture.value=r}else!1!==this.defines.USE_CUTER&&(this.defines.USE_CUTER=!1,t=!0),0!==this.defines.NUM_CLIPPING_ARRAY_LENGTH&&(this.defines.NUM_CLIPPING_ARRAY_LENGTH=0,t=!0),0!==this.defines.NUM_CLIPPING_BOX&&(this.defines.NUM_CLIPPING_BOX=0,t=!0),this.uniforms.clipperPlanesArray.value=new Float32Array,this.uniforms.clipperPlanesTexture.value=null;t&&(this.needsUpdate=!0)}},clipperFloors:{get:function(){return this.uniforms.clipperFloors.value},set:function(e){this.uniforms.clipperFloors.value=e}},globalFloorInfo:{get:function(){return this.uniforms.globalFloorInfo.value},set:function(e){var t=this.defines.NUM_FLOOR_COUNT;if(e&&t!==e.length){this.defines.NUM_FLOOR_COUNT=e.length,this.uniforms.globalFloorInfo.value=e;var n=[];e.forEach((function(e){n.push(e.x),n.push(e.y),n.push(0),n.push(0)}));var r=e.length,o=new i.DataTexture(new Float32Array(n),r,1,i.RGBAFormat,i.FloatType);o.wrapS=i.ClampToEdgeWrapping,o.wrapT=i.ClampToEdgeWrapping,o.minFilter=i.NearestFilter,o.magFilter=i.NearestFilter,this.uniforms.globalFloorInfoTexture.value&&this.uniforms.globalFloorInfoTexture.value.dispose(),this.uniforms.globalFloorInfoTexture.value=o,this.needsUpdate=!0}}}}),d.pano0=null!==(n=t.pano0)&&void 0!==n?n:null,d.pano1=null!==(r=t.pano1)&&void 0!==r?r:null,d.modelAlpha=null!==(o=t.modelAlpha)&&void 0!==o?o:1,d.progress=null!==(a=t.progress)&&void 0!==a?a:0,d.useBlackTransition=null!==(s=t.useBlackTransition)&&void 0!==s&&s,d.modelColorInfo=null!==(l=t.modelColorInfo)&&void 0!==l?l:null,d.opacity=null!==(c=t.opacity)&&void 0!==c?c:1,d.originOpacity=1,d.floorIndex=null!==(u=t.floorIndex)&&void 0!==u?u:-1,d.floorInfo=null!==(h=t.floorInfo)&&void 0!==h?h:null,d.clippers=null,d.clipperPlanesArray=null,d.clipperFloors=null,d.globalFloorInfo=null,d}return ie(t,e),t}(i.ShaderMaterial),Tt=function(e){function t(t){var n=t.preserveDrawingBuffer,r=void 0===n||n,o=t.backgroundColor,a=void 0===o?1579548:o,s=t.backgroundAlpha,l=void 0===s?1:s,c=t.pixelRatio,u=void 0===c?1:c,h=t.antialias,d=void 0!==h&&h,p=t.webgl2,f=this;if(void 0!==p&&p){var A=document.createElement("canvas"),v=A.getContext("webgl2");if(null===v)throw new Error("error occurred when getting webgl2 canvas context");f=e.call(this,{antialias:d,preserveDrawingBuffer:r,alpha:l<1,canvas:A,context:v})||this}else f=e.call(this,{antialias:d,preserveDrawingBuffer:r,alpha:l<1})||this;return f.setPixelRatio(u),f.setClearColor(a,l),f.outputEncoding=i.sRGBEncoding,f.autoClear=!0,f}return ie(t,e),t}(i.WebGLRenderer),Pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ie(t,e),t.prototype.add=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.add.apply(this,t)},t.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.remove.apply(this,t)},t}(i.Scene);function Rt(e,t){var n=Math.abs(Math.cos(e.latitude)),r=-Math.sin(e.longitude)*n,o=-Math.sin(e.latitude),a=-Math.cos(e.longitude)*n;return t?t.set(r,o,a):new i.Vector3(r,o,a)}var Lt=2*Math.PI,Ot=Math.PI/2;function Ft(e){return e>0&&e<=Lt?e:(e%Lt+Lt)%Lt}var kt,Dt,Qt,Nt,Vt=function(e){function t(t,n,r,o,a,s){void 0===n&&(n=1),void 0===r&&(r=.01),void 0===o&&(o=1e3),void 0===a&&(a=new i.Vector2),void 0===s&&(s=1);var l=e.call(this)||this;l.fov=t,l.aspect=n,l.near=r,l.far=o,l.perspToOrtho=a,l.orthoDistance=s,l.needsRender=!0,l.pose={longitude:0,latitude:0,fov:t,distance:0,offset:new i.Vector3},l.computePose(),l.perspectiveCamera=new i.PerspectiveCamera(l.fov,l.aspect,.001,l.far);var c=Math.max(l.orthoDistance,.01)*Math.tan(.5*l.fov/180*Math.PI),u=-.5*l.aspect*2*c;return l.orthographicCamera=new i.OrthographicCamera(u,-u,c,-c,.001,l.far),l.computeProjectionMatrix(),l.lastValues={position:l.position.clone(),quaternion:l.quaternion.clone(),scale:l.scale.clone(),fov:l.fov,aspect:l.aspect,near:l.near,far:l.far,perspToOrtho:l.perspToOrtho.clone(),orthoDistance:l.orthoDistance},l.type=l.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera",l}return ie(t,e),t.prototype.getDirection=function(e){return Rt(this.pose,e)},t.prototype.computePose=function(e){void 0===e&&(e=0);var t=this.getDirection(new i.Vector3);this.pose.longitude=Ft(-Math.atan2(t.x,-t.z)),this.pose.latitude=-Math.asin(t.y/1),this.pose.fov=this.fov,this.pose.distance=e;var n=(new i.Vector3).add(this.position).add(t.clone().setLength(this.pose.distance));return this.pose.offset.copy(n),this},t.prototype.setFromPose=function(e){var t,n,i,r,o,a=Ft(null!==(t=e.longitude)&&void 0!==t?t:this.pose.longitude),s=Math.max(1e-4-Ot,Math.min(Ot-1e-4,null!==(n=e.latitude)&&void 0!==n?n:this.pose.latitude)),l=null!==(i=e.fov)&&void 0!==i?i:this.pose.fov,c=null!==(r=e.distance)&&void 0!==r?r:this.pose.distance,u=null!==(o=e.offset)&&void 0!==o?o:this.pose.offset,h=Rt({longitude:a,latitude:s}).normalize();return this.position.set(0,0,0),this.lookAt(h),this.position.add(u).sub(h.clone().setLength(c)),this.fov!==l&&(this.fov=l,this.updateProjectionMatrix()),this.updateMatrixWorld(),this.pose.longitude=a,this.pose.latitude=s,this.pose.fov=l,this.pose.distance=c,this.pose.offset.copy(u),this.needsRender=!0,this},t.prototype.copyPose=function(){return{longitude:this.pose.longitude,latitude:this.pose.latitude,fov:this.pose.fov,distance:this.pose.distance,offset:this.pose.offset.clone()}},t.prototype.computeProjectionMatrix=function(){!function(e,t,n,i){n=Math.pow(n,2);for(var r=0;r<16;r++)i.elements[r]=e.elements[r]+(t.elements[r]-e.elements[r])*n}(this.orthographicCamera.projectionMatrix,this.perspectiveCamera.projectionMatrix,1-this.perspToOrtho.x,this.projectionMatrix),this.projectionMatrixInverse.getInverse(this.projectionMatrix),this.needsRender=!0},t.prototype.setViewOffset=function(e,t,n,i,r,o){this.perspectiveCamera.setViewOffset(e,t,n,i,r,o),this.orthographicCamera.setViewOffset(e,t,n,i,r,o),this.computeProjectionMatrix()},t.prototype.clearViewOffset=function(){this.perspectiveCamera.clearViewOffset(),this.orthographicCamera.clearViewOffset(),this.computeProjectionMatrix()},t.prototype.updateProjectionMatrix=function(){this.perspectiveCamera.updateProjectionMatrix(),this.orthographicCamera.updateProjectionMatrix(),this.computeProjectionMatrix()},Object.defineProperty(t.prototype,"perspectiveProjectionMatrix",{get:function(){return this.perspectiveCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"perspectiveProjectionMatrixInverse",{get:function(){return this.perspectiveCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrix",{get:function(){return this.orthographicCamera.projectionMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orthographicProjectionMatrixInverse",{get:function(){return this.orthographicCamera.projectionMatrixInverse},enumerable:!1,configurable:!0}),t.prototype.updateTime=function(e,t){var n=!1;if(this.lastValues.fov===this.fov&&this.lastValues.near===this.near&&this.lastValues.far===this.far&&this.lastValues.aspect===this.aspect||(this.perspectiveCamera.fov=this.fov,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.updateProjectionMatrix(),n=!0),!this.lastValues.position.equals(this.position)||!this.lastValues.quaternion.equals(this.quaternion)||!this.lastValues.scale.equals(this.scale)||this.lastValues.orthoDistance!==this.orthoDistance||this.lastValues.fov!==this.fov||this.lastValues.near!==this.near||this.lastValues.far!==this.far||this.lastValues.aspect!==this.aspect){var i=Math.max(this.orthoDistance,.01)*Math.tan(.5*this.fov/180*Math.PI),r=-.5*this.aspect*2*i;this.orthographicCamera.left=r,this.orthographicCamera.right=-r,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.updateProjectionMatrix(),n=!0}this.lastValues.perspToOrtho.equals(this.perspToOrtho)||(n=!0),n&&this.computeProjectionMatrix(),this.lastValues.position.copy(this.position),this.lastValues.quaternion.copy(this.quaternion),this.lastValues.scale.copy(this.scale),this.lastValues.fov=this.fov,this.lastValues.aspect=this.aspect,this.lastValues.near=this.near,this.lastValues.far=this.far,this.lastValues.perspToOrtho.copy(this.perspToOrtho),this.lastValues.orthoDistance=this.orthoDistance,this.type=this.perspToOrtho.x<1?"PerspectiveCamera":"OrthographicCamera"},Object.defineProperty(t.prototype,"isPerspectiveCamera",{get:function(){return this.perspToOrtho.x<1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOrthographicCamera",{get:function(){return this.perspToOrtho.x>=1},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,n){return e.prototype.copy.call(this,t,n),this.fov=t.fov,this.aspect=t.aspect,this.near=t.near,this.far=t.far,this.perspToOrtho.copy(t.perspToOrtho),this.orthoDistance=t.orthoDistance,this.updateTime(de(),0),this},t}(i.Camera),Ut=function(){function e(e,t,n){this.x=e,this.y=t,this.z=n}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},e.prototype.set=function(e,t,n){return this.x=e,this.y=t,this.z=n,this},e.prototype.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},e.prototype.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},e.prototype.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},e.prototype.cross=function(e){var t=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-t*e.z,this.z=t*e.y-n*e.x,this},e.prototype.crossVectors=function(e,t){var n=e.x,i=e.y,r=e.z,o=t.x,a=t.y,s=t.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e}(),zt=function(e,t,n){this.extents=e,this.startIndex=t,this.endIndex=n},qt=function(e,t){this.triangle=e,this.intersectionPoint=t},Ht=(kt=new Ut(0,0,0),Dt=new Ut(0,0,0),Qt=new Ut(0,0,0),Nt=new Ut(0,0,0),function(e,t,n,i,r,o){Dt.subVectors(t,e),Qt.subVectors(n,e),Nt.crossVectors(Dt,Qt);var a,s=r.dot(Nt);if(s>0){if(o)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}kt.subVectors(i,e);var l=a*r.dot(Qt.crossVectors(kt,Qt));if(l<0)return null;var c=a*r.dot(Dt.cross(kt));if(c<0)return null;if(l+c>s)return null;var u=-a*kt.dot(Nt);if(u<0)return null;var h=u/s;return new Ut(0,0,0).copy(r).multiplyScalar(h).add(i)}),_t=function(e,t){this.min=e,this.max=t};function jt(e,t,n){var i=new _t(0,0);t.x>=0?(i.min=(n.extents[0]-e.x)*t.x,i.max=(n.extents[3]-e.x)*t.x):(i.min=(n.extents[3]-e.x)*t.x,i.max=(n.extents[0]-e.x)*t.x);var r=new _t(0,0);if(t.y>=0?(r.min=(n.extents[1]-e.y)*t.y,r.max=(n.extents[4]-e.y)*t.y):(r.min=(n.extents[4]-e.y)*t.y,r.max=(n.extents[1]-e.y)*t.y),i.min>r.max||r.min>i.max)return!1;r.min>i.min&&(i.min=r.min),r.max<i.max&&(i.max=r.max);var o=new _t(0,0);return t.z>=0?(o.min=(n.extents[2]-e.z)*t.z,o.max=(n.extents[5]-e.z)*t.z):(o.min=(n.extents[5]-e.z)*t.z,o.max=(n.extents[2]-e.z)*t.z),!(i.min>o.max||o.min>i.max)&&(o.min>i.min&&(i.min=o.min),o.max<i.max&&(i.max=o.max),!(i.max<0))}function Kt(e,t,n,i,r){if(n>=i)return[0,0,0,0,0,0];for(var o=1/0,a=1/0,s=1/0,l=-1/0,c=-1/0,u=-1/0,h=n,d=void 0,p=void 0;h<i;h++)(p=t[d=6*e[h]])<o&&(o=p),(p=t[d+1])<a&&(a=p),(p=t[d+2])<s&&(s=p),(p=t[d+3])>l&&(l=p),(p=t[d+4])>c&&(c=p),(p=t[d+5])>u&&(u=p);return[o-r,a-r,s-r,l+r,c+r,u+r]}function Gt(e,t,n){return e<t?t:e>n?n:e}var Wt=1e-6,Xt=function(){function e(){}return e.prototype.create=function(e){return this.trianglesArray=e,this},e.prototype.splitNode=function(e){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");for(var t=this.trianglesArray,n=t.length/9,i=new Uint32Array(n),r=new Float32Array(6*n),o=[],a=0,s=1/0,l=1/0,c=1/0,u=-1/0,h=-1/0,d=-1/0,p=0,f=0,A=0,v=void 0,m=void 0,g=void 0,y=void 0,b=void 0,x=void 0,w=void 0;p<n;p++,f+=6,A+=9)i[p]=p,v=y=t[A],(w=t[A+3])<v&&(v=w),w>y&&(y=w),(w=t[A+6])<v&&(v=w),w>y&&(y=w),m=b=t[A+1],(w=t[A+4])<m&&(m=w),w>b&&(b=w),(w=t[A+7])<m&&(m=w),w>b&&(b=w),g=x=t[A+2],(w=t[A+5])<g&&(g=w),w>x&&(x=w),(w=t[A+8])<g&&(g=w),w>x&&(x=w),v<s&&(s=v),y>u&&(u=y),m<l&&(l=m),b>h&&(h=b),g<c&&(c=g),x>d&&(d=x),r[f]=v,r[f+1]=m,r[f+2]=g,r[f+3]=y,r[f+4]=b,r[f+5]=x;var M=new zt([s,l,c,u,h,d],0,n);function C(t){for(var n=t.startIndex,s=t.endIndex,l=t.extents,c=[l[3]-l[0],l[4]-l[1],l[5]-l[2]],u=[0,1,2].sort((function(e,t){return c[t]-c[e]})),h=0;h<3;h++){for(var d=u[h],p=l[d]+l[d+3],f=n,A=s-1,v=-1,m=void 0;f<=A;)-1===v?(m=i[f],r[6*m+d]+r[6*m+d+3]<p?f++:v=m):(m=i[A],r[6*m+d]+r[6*m+d+3]>=p||(i[f]=m,i[A]=v,v=-1,f++),A--);if(f>n&&f<s){var g=new zt(Kt(i,r,n,f,Wt),n,f);g.endIndex-g.startIndex>e&&(o[a++]=g);var y=new zt(Kt(i,r,f,s,Wt),f,s);y.endIndex-y.startIndex>e&&(o[a++]=y),t.node0=g,t.node1=y,t.startIndex=0,t.endIndex=0;break}}}for(o[a++]=M;a;)C(o[--a]);return this.offsetArray=i,this.rootNode=M,o.length=0,this},e.prototype.intersectRay=function(e,t,n){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");if(!this.rootNode||!this.offsetArray)throw new Error("bvh-tree never perpared. call `splitNode` to perpare.");for(var i,r=this.trianglesArray,o=this.offsetArray,a=this.rootNode,s=[],l=[],c=new Ut(1/t.x,1/t.y,1/t.z),u=[a];i=u.pop();)if(jt(e,c,i)){i.node0&&u.push(i.node0),i.node1&&u.push(i.node1);for(var h=i.startIndex;h<i.endIndex;h++)s.push(o[h])}for(var d=new Ut(0,0,0),p=new Ut(0,0,0),f=new Ut(0,0,0),A=new Ut(e.x,e.y,e.z),v=new Ut(t.x,t.y,t.z),m=(h=0,void 0),g=s.length;h<g;h++){m=9*s[h],d.x=r[m],d.y=r[m+1],d.z=r[m+2],p.x=r[m+3],p.y=r[m+3+1],p.z=r[m+3+2],f.x=r[m+6],f.y=r[m+6+1],f.z=r[m+6+2];var y=Ht(d,p,f,A,v,n);y&&l.push(new qt([d.clone(),p.clone(),f.clone()],y))}return l},e.prototype.trianglesInSphere=function(e,t){if(!this.trianglesArray)throw new Error("bvh-tree never perpared. call `create` to initialize.");if(!this.rootNode||!this.offsetArray)throw new Error("bvh-tree never perpared. call `splitNode` to perpare.");for(var n,i=this.trianglesArray,r=this.offsetArray,o=[this.rootNode],a=[];n=o.pop();){var s=Gt(e.x,n.extents[0],n.extents[3])-e.x,l=Gt(e.y,n.extents[1],n.extents[4])-e.y,c=Gt(e.z,n.extents[2],n.extents[5])-e.z;if(s*s+l*l+c*c<=t*t){n.node0&&o.push(n.node0),n.node1&&o.push(n.node1);for(var u=n.startIndex;u<n.endIndex;u++)a.push(r[u])}}var h=a.length,d=new Float32Array(9*h);for(u=0;u<h;u++){var p=9*a[u];d[9*u]=i[p],d[9*u+1]=i[p+1],d[9*u+2]=i[p+2],d[9*u+3]=i[p+3],d[9*u+4]=i[p+4],d[9*u+5]=i[p+5],d[9*u+6]=i[p+6],d[9*u+7]=i[p+7],d[9*u+8]=i[p+8]}return d},e.prototype.dispose=function(){delete this.offsetArray,delete this.rootNode},e}(),Yt=!1,Zt=[];function Jt(e){if(void 0===e&&(e=!1),e||!Yt){Yt=!0;var t=Zt.shift();if(t){try{t()}catch(e){}Fe.shared.add((function(){return Jt(!0)}),!0,2,-100)}else Yt=!1}}function $t(e){return new Promise((function(t,n){Zt.push((function(){try{t(e())}catch(e){n(e)}})),Fe.shared.add((function(){return Jt()}),!0,2,-100)}))}function en(){var e={OutWindow:function(){this._windowSize=0}};return e.OutWindow.prototype.create=function(e){this._buffer&&this._windowSize===e||(this._buffer=[]),this._windowSize=e,this._pos=0,this._streamPos=0},e.OutWindow.prototype.flush=function(){var e=this._pos-this._streamPos;if(0!==e){for(;e--;)this._stream.writeByte(this._buffer[this._streamPos++]);this._pos>=this._windowSize&&(this._pos=0),this._streamPos=this._pos}},e.OutWindow.prototype.releaseStream=function(){this.flush(),this._stream=null},e.OutWindow.prototype.setStream=function(e){this.releaseStream(),this._stream=e},e.OutWindow.prototype.init=function(e){e||(this._streamPos=0,this._pos=0)},e.OutWindow.prototype.copyBlock=function(e,t){var n=this._pos-e-1;for(n<0&&(n+=this._windowSize);t--;)n>=this._windowSize&&(n=0),this._buffer[this._pos++]=this._buffer[n++],this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.putByte=function(e){this._buffer[this._pos++]=e,this._pos>=this._windowSize&&this.flush()},e.OutWindow.prototype.getByte=function(e){var t=this._pos-e-1;return t<0&&(t+=this._windowSize),this._buffer[t]},e.RangeDecoder=function(){},e.RangeDecoder.prototype.setStream=function(e){this._stream=e},e.RangeDecoder.prototype.releaseStream=function(){this._stream=null},e.RangeDecoder.prototype.init=function(){var e=5;for(this._code=0,this._range=-1;e--;)this._code=this._code<<8|this._stream.readByte()},e.RangeDecoder.prototype.decodeDirectBits=function(e){for(var t,n=0,i=e;i--;)this._range>>>=1,t=this._code-this._range>>>31,this._code-=this._range&t-1,n=n<<1|1-t,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8);return n},e.RangeDecoder.prototype.decodeBit=function(e,t){var n=e[t],i=(this._range>>>11)*n;return(2147483648^this._code)<(2147483648^i)?(this._range=i,e[t]+=2048-n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),0):(this._range-=i,this._code-=i,e[t]-=n>>>5,0==(4278190080&this._range)&&(this._code=this._code<<8|this._stream.readByte(),this._range<<=8),1)},e.initBitModels=function(e,t){for(;t--;)e[t]=1024},e.BitTreeDecoder=function(e){this._models=[],this._numBitLevels=e},e.BitTreeDecoder.prototype.init=function(){e.initBitModels(this._models,1<<this._numBitLevels)},e.BitTreeDecoder.prototype.decode=function(e){for(var t=1,n=this._numBitLevels;n--;)t=t<<1|e.decodeBit(this._models,t);return t-(1<<this._numBitLevels)},e.BitTreeDecoder.prototype.reverseDecode=function(e){for(var t,n=1,i=0,r=0;r<this._numBitLevels;++r)n=n<<1|(t=e.decodeBit(this._models,n)),i|=t<<r;return i},e.reverseDecode2=function(e,t,n,i){for(var r,o=1,a=0,s=0;s<i;++s)o=o<<1|(r=n.decodeBit(e,t+o)),a|=r<<s;return a},e.LenDecoder=function(){this._choice=[],this._lowCoder=[],this._midCoder=[],this._highCoder=new e.BitTreeDecoder(8),this._numPosStates=0},e.LenDecoder.prototype.create=function(t){for(;this._numPosStates<t;++this._numPosStates)this._lowCoder[this._numPosStates]=new e.BitTreeDecoder(3),this._midCoder[this._numPosStates]=new e.BitTreeDecoder(3)},e.LenDecoder.prototype.init=function(){var t=this._numPosStates;for(e.initBitModels(this._choice,2);t--;)this._lowCoder[t].init(),this._midCoder[t].init();this._highCoder.init()},e.LenDecoder.prototype.decode=function(e,t){return 0===e.decodeBit(this._choice,0)?this._lowCoder[t].decode(e):0===e.decodeBit(this._choice,1)?8+this._midCoder[t].decode(e):16+this._highCoder.decode(e)},e.Decoder2=function(){this._decoders=[]},e.Decoder2.prototype.init=function(){e.initBitModels(this._decoders,768)},e.Decoder2.prototype.decodeNormal=function(e){var t=1;do{t=t<<1|e.decodeBit(this._decoders,t)}while(t<256);return 255&t},e.Decoder2.prototype.decodeWithMatchByte=function(e,t){var n,i,r=1;do{if(n=t>>7&1,t<<=1,r=r<<1|(i=e.decodeBit(this._decoders,(1+n<<8)+r)),n!==i){for(;r<256;)r=r<<1|e.decodeBit(this._decoders,r);break}}while(r<256);return 255&r},e.LiteralDecoder=function(){},e.LiteralDecoder.prototype.create=function(t,n){var i;if(!this._coders||this._numPrevBits!==n||this._numPosBits!==t)for(this._numPosBits=t,this._posMask=(1<<t)-1,this._numPrevBits=n,this._coders=[],i=1<<this._numPrevBits+this._numPosBits;i--;)this._coders[i]=new e.Decoder2},e.LiteralDecoder.prototype.init=function(){for(var e=1<<this._numPrevBits+this._numPosBits;e--;)this._coders[e].init()},e.LiteralDecoder.prototype.getDecoder=function(e,t){return this._coders[((e&this._posMask)<<this._numPrevBits)+((255&t)>>>8-this._numPrevBits)]},e.Decoder=function(){this._outWindow=new e.OutWindow,this._rangeDecoder=new e.RangeDecoder,this._isMatchDecoders=[],this._isRepDecoders=[],this._isRepG0Decoders=[],this._isRepG1Decoders=[],this._isRepG2Decoders=[],this._isRep0LongDecoders=[],this._posSlotDecoder=[],this._posDecoders=[],this._posAlignDecoder=new e.BitTreeDecoder(4),this._lenDecoder=new e.LenDecoder,this._repLenDecoder=new e.LenDecoder,this._literalDecoder=new e.LiteralDecoder,this._dictionarySize=-1,this._dictionarySizeCheck=-1,this._posSlotDecoder[0]=new e.BitTreeDecoder(6),this._posSlotDecoder[1]=new e.BitTreeDecoder(6),this._posSlotDecoder[2]=new e.BitTreeDecoder(6),this._posSlotDecoder[3]=new e.BitTreeDecoder(6)},e.Decoder.prototype.setDictionarySize=function(e){return!(e<0)&&(this._dictionarySize!==e&&(this._dictionarySize=e,this._dictionarySizeCheck=Math.max(this._dictionarySize,1),this._outWindow.create(Math.max(this._dictionarySizeCheck,4096))),!0)},e.Decoder.prototype.setLcLpPb=function(e,t,n){var i=1<<n;return!(e>8||t>4||n>4)&&(this._literalDecoder.create(t,e),this._lenDecoder.create(i),this._repLenDecoder.create(i),this._posStateMask=i-1,!0)},e.Decoder.prototype.init=function(){var t=4;for(this._outWindow.init(!1),e.initBitModels(this._isMatchDecoders,192),e.initBitModels(this._isRep0LongDecoders,192),e.initBitModels(this._isRepDecoders,12),e.initBitModels(this._isRepG0Decoders,12),e.initBitModels(this._isRepG1Decoders,12),e.initBitModels(this._isRepG2Decoders,12),e.initBitModels(this._posDecoders,114),this._literalDecoder.init();t--;)this._posSlotDecoder[t].init();this._lenDecoder.init(),this._repLenDecoder.init(),this._posAlignDecoder.init(),this._rangeDecoder.init()},e.Decoder.prototype.decode=function(t,n,i){var r,o,a,s,l,c,u=0,h=0,d=0,p=0,f=0,A=0,v=0;for(this._rangeDecoder.setStream(t),this._outWindow.setStream(n),this.init();i<0||A<i;)if(r=A&this._posStateMask,0===this._rangeDecoder.decodeBit(this._isMatchDecoders,(u<<4)+r))o=this._literalDecoder.getDecoder(A++,v),v=u>=7?o.decodeWithMatchByte(this._rangeDecoder,this._outWindow.getByte(h)):o.decodeNormal(this._rangeDecoder),this._outWindow.putByte(v),u=u<4?0:u-(u<10?3:6);else{if(1===this._rangeDecoder.decodeBit(this._isRepDecoders,u))a=0,0===this._rangeDecoder.decodeBit(this._isRepG0Decoders,u)?0===this._rangeDecoder.decodeBit(this._isRep0LongDecoders,(u<<4)+r)&&(u=u<7?9:11,a=1):(0===this._rangeDecoder.decodeBit(this._isRepG1Decoders,u)?s=d:(0===this._rangeDecoder.decodeBit(this._isRepG2Decoders,u)?s=p:(s=f,f=p),p=d),d=h,h=s),0===a&&(a=2+this._repLenDecoder.decode(this._rangeDecoder,r),u=u<7?8:11);else if(f=p,p=d,d=h,a=2+this._lenDecoder.decode(this._rangeDecoder,r),u=u<7?7:10,(l=this._posSlotDecoder[a<=5?a-2:3].decode(this._rangeDecoder))>=4){if(h=(2|1&l)<<(c=(l>>1)-1),l<14)h+=e.reverseDecode2(this._posDecoders,h-l-1,this._rangeDecoder,c);else if(h+=this._rangeDecoder.decodeDirectBits(c-4)<<4,(h+=this._posAlignDecoder.reverseDecode(this._rangeDecoder))<0){if(-1===h)break;return!1}}else h=l;if(h>=A||h>=this._dictionarySizeCheck)return!1;this._outWindow.copyBlock(h,a),A+=a,v=this._outWindow.getByte(0)}return this._outWindow.flush(),this._outWindow.releaseStream(),this._rangeDecoder.releaseStream(),!0},e.Decoder.prototype.setDecoderProperties=function(e){var t,n,i,r,o;return!(e.size<5)&&(n=(t=e.readByte())%9,i=(t=~~(t/9))%5,r=~~(t/5),!!this.setLcLpPb(n,i,r)&&(o=e.readByte(),o|=e.readByte()<<8,o|=e.readByte()<<16,o+=16777216*e.readByte(),this.setDictionarySize(o)))},e.decompress=function(t,n,i,r){var o=new e.Decoder;if(!o.setDecoderProperties(t))throw"Incorrect stream properties";if(!o.decode(n,i,r))throw"Error in data stream";return!0},e.decompressFile=function(t,n){var i,r=new e.Decoder;if(!r.setDecoderProperties(t))throw"Incorrect stream properties";if(i=t.readByte(),i|=t.readByte()<<8,i|=t.readByte()<<16,i+=16777216*t.readByte(),t.readByte(),t.readByte(),t.readByte(),t.readByte(),!r.decode(t,n,i))throw"Error in data stream";return!0},e}var tn=en();var nn="\nvar decodeLZMA = (function() {\n var LZMA = (".concat(en.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,n){try{var i={data:t,offset:0,readByte:function(){return this.data[this.offset++]}},r=i.data.length,o={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/r);this.data[t]||(this.data[t]=new Uint8Array(r)),this.data[t][this.offset%r]=e,this.offset++}};e.decompressFile(i,o);for(var a=new Uint8Array(o.offset),s=0;s<o.offset;s++)a[s]=o.data[Math.floor(s/r)][s%r];n(null,a)}catch(e){n(e)}}.toString(),")(LZMA, data, callback);\n }\n})();\n\nvar decodeLZMAWithWASM = (function() {\n var LZMA_WASM = (").concat(function(){return function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),i=0;i<64;i++)n[t.charCodeAt(i)]=i;var r,o,a,s,l,c=.75*e.length,u=e.length,h=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);var d=new ArrayBuffer(c),p=new Uint8Array(d);for(r=0;r<u;r+=4)o=n[e.charCodeAt(r)],a=n[e.charCodeAt(r+1)],s=n[e.charCodeAt(r+2)],l=n[e.charCodeAt(r+3)],p[h++]=o<<2|a>>4,p[h++]=(15&a)<<4|s>>2,p[h++]=(3&s)<<6|63&l;return d}("AGFzbQEAAAABSg1gAABgAX8Bf2ACf38Bf2AEf39/fwBgA39/fwBgAX8AYAJ/fwBgA39/fwF/YAR/f39/AX9gAn9/AGABfwF/YAABf2AEf39/fwF/AhsCA2VudgVhYm9ydAADA2VudgZtZW1vcnkCAAEDJiUBAQkKAgoKCwsLCwsAAgoBAgQKAQYFCAoFBQQEBwgCBwwCAQAABAQBcAABBhoFfwFBAAt/AUEAC38BQQALfwFBAAt/AUEACwc9BgZtZW1vcnkCAAV0YWJsZQEABXJlc2V0AA0KbmV3VThBcnJheQAQCnVucGFja1NpemUAFAZkZWNvZGUAIwgBJAkHAQBBAAsBJQqAViVoAQN/IABBgICAgARLBEAACyMBIgEgAEEBIABBAUsbakEHakF4cSICPwAiA0EQdEsEQCADIAIgAWtB//8DakGAgHxxQRB2IgAgAyAAShtAAEEASARAIABAAEEASARAAAsLCyACJAEgAQsbAQF/QQFBICAAQQdqZ2t0EAEiASAANgIAIAELkQMBAX8gAUUEQA8LIABBADoAACAAIAFqQQFrQQA6AAAgAUECTQRADwsgAEEBakEAOgAAIABBAmpBADoAACAAIAFqIgJBAmtBADoAACACQQNrQQA6AAAgAUEGTQRADwsgAEEDakEAOgAAIAAgAWpBBGtBADoAACABQQhNBEAPC0EAIABrQQNxIgIgAGoiAEEANgIAIAEgAmtBfHEiASAAakEEa0EANgIAIAFBCE0EQA8LIABBBGpBADYCACAAQQhqQQA2AgAgACABaiICQQxrQQA2AgAgAkEIa0EANgIAIAFBGE0EQA8LIABBDGpBADYCACAAQRBqQQA2AgAgAEEUakEANgIAIABBGGpBADYCACAAIAFqIgJBHGtBADYCACACQRhrQQA2AgAgAkEUa0EANgIAIAJBEGtBADYCACAAQQRxQRhqIgIgAGohACABIAJrIQEDQCABQSBPBEAgAEIANwMAIABBCGpCADcDACAAQRBqQgA3AwAgAEEYakIANwMAIAFBIGshASAAQSBqIQAMAQsLC1EBA38gAEH+////AEsEQEEAQSBBLUEnEAAACyAAQQJ0IgMQAiECQQgQASIBQQA2AgAgAUEANgIEIAEgAjYCACABIAA2AgQgAkEIaiADEAMgAQtmAQF/IAFB/P///wFLBEBBAEHAAEEXQSIQAAALIAFBAXQiARACIgJBCGogARADIABFBEBBDBABIQALIABBADYCACAAQQA2AgQgAEEANgIIIAAgAjYCACAAQQA2AgQgACABNgIIIAALCgBBDBABIAAQBQsuAQF/QQgQASIBQQA2AgAgAUEANgIEIAEgADYCBCABQQEgASgCBHQQBjYCACABC6EBAQR/QRAQASIBQQA2AgAgAUEANgIEIAFBADYCCCABQQA2AgxBEBAEIQIDQCAAQRBIBEBBAxAHIQMgAigCACAAQQJ0aiADNgIIIABBAWohAAwBCwsgASACNgIEQRAQBCECQQAhAANAIABBEEgEQEEDEAchAyACKAIAIABBAnRqIAM2AgggAEEBaiEADAELCyABIAI2AgggAUEIEAc2AgwgAQs0AQF/QRQQASIAQQA2AgAgAEEAOgAEIABBADYCCCAAQQA2AgwgAEEANgIQIABBDTYCCCAAC0IBAX9BGRABIgBBADYCACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEANgIUIABBADoAGCAAQQA2AhAgAAu1AgEEf0HQABABIgBBADoAACAAQQA2AgQgAEEANgIIIABBADYCDCAAQQA2AhAgAEEAOgAUIABBADYCGCAAQQA2AhwgAEEANgIgIABBADYCJCAAQQA2AiggAEEANgIsIABBADYCMCAAQQA2AjQgAEEANgI4IABBADYCPCAAQQA2AkAgAEEANgJEIABBADYCSCAAQQA2AkxBBBAEIQIDQCABQQRIBEBBBhAHIQMgAigCACABQQJ0aiADNgIIIAFBAWohAQwBCwsgACACNgIkIABBBBAHNgIoIABB8wAQBjYCLCAAQcABEAY2AjAgAEEMEAY2AjQgAEEMEAY2AjggAEEMEAY2AjwgAEEMEAY2AkAgAEHAARAGNgJEIAAQCDYCSCAAEAg2AkwgABAJNgIEIAAQCjYCCCAACx8BAX9BCBABIgBBADYCACAAQQA2AgQgABALNgIAIAALCgAjACQBEAwkAwthAQF/IAFB+P///wNLBEBBAEHAAEEXQSIQAAALIAEQAiICQQhqIAEQAyAARQ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AygCAEECdkkEfyACQQJ0IANqKAIIBQALKAIAQQEkBBAYGiACQQFqIQIMAQsLIAEoAigoAgBBASQEEBgaIAEoAixBASQEEBgaIAAoAjBBASQEEBgaIAAoAjRBASQEEBgaIAAoAjhBASQEEBgaIAAoAjxBASQEEBgaIAAoAkBBASQEEBgaIAAoAkRBASQEEBgaIAAoAkgQGSAAKAJMEBkLyAwBA38DQCABQQNxIAIgAhsEQCAAIgRBAWohACABIgNBAWohASAEIAMtAAA6AAAgAkEBayECDAELCyAAQQNxRQRAA0AgAkEQTwRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAEEIaiABQQhqKAIANgIAIABBDGogAUEMaigCADYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsgAkEIcQRAIAAgASgCADYCACAAQQRqIAFBBGooAgA2AgAgAUEIaiEBIABBCGohAAsgAkEEcQRAIAAgASgCADYCACABQQRqIQEgAEEEaiEACyACQQJxBEAgACABLwEAOwEAIAFBAmohASAAQQJqIQALIAJBAXEEQCAAIAEtAAA6AAALDwsgAkEgTwRAAkACQAJAIABBA3EiA0EBRwRAIANBAkYNASADQQNGDQIMAwsgASgCACEFIAAgASIDLQAAOgAAIABBAWoiASABIANBAWoiAS0AADoAAEEBaiIEQQFqIQAgAUEBaiIDQQFqIQEgBCADLQAAOgAAIAJBA2shAgNAIAJBEU8EQCAAIAFBAWooAgAiA0EIdCAFQRh2cjYCACAAQQRqIAFBBWooAgAiBUEIdCADQRh2cjYCACAAQQhqIAFBCWooAgAiA0EIdCAFQRh2cjYCACAAQQxqIAFBDWooAgAiBUEIdCADQRh2cjYCACABQRBqIQEgAEEQaiEAIAJBEGshAgwBCwsMAgsgASgCACEFIAAgAS0AADoAACAAQQFqIgRBAWohACABQQFqIgNBAWohASAEIAMtAAA6AAAgAkECayECA0AgAkESTwRAIAAgAUECaigCACIDQRB0IAVBEHZyNgIAIABBBGogAUEGaigCACIFQRB0IANBEHZyNgIAIABBCGogAUEKaigCACIDQRB0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CIHOgAIIAIoAgQgAigCAGogA0H/AXFBCW4iAzoACCADQQVwIQUgAigCBCACKAIAQQJqaiADQQVuIgM6AAggAigCBCACKAIAQQNqaiAFOgAIIAQgBzYCDCAEIAM2AhAgBCAFOgAUIARBADYCHEEAIQIDQAJAIAJBBE8NACAEIAQoAhwgBigCBCAGKAIAIAJBAWpqai0ACCACQQN0dHI2AhwgAkEBaiECDAELCyAEIAQoAhw2AhggBCgCGEGAIEkEQCAEQYAgNgIYC0EAIQJBACEFQQAhAwNAAkAgA0EITg0AIAYgA0EFahARQf8BcSIEQf8BRwRAQQEhBQsgBCADQQN0dCACciECIANBAWohAwwBCwsgACgCACAFRToAACAAKAIAKAIEIAE2AgAgACgCABAWAkAgACgCACAFIAIQICIBQQFGDQAgAUEDRwRAIAFBAkYEQCAFBEAgACgCACgCCCgCECACRw0DCwUMAgsLIAAoAgAoAgQtAAQaQQFBACAAKAIAKAIIKAIQIAAoAgAoAggoAgQQIQ8LQQBBAUEAQQAQIQsIACMDIAAQIgsWAEG4ASQAIwAkAUGAgIAIJAIQDCQDCwMAAQsLtwEEAEEICxcKAAAAdQBzAGUAIABzAHQAcgBpAGMAdABBIAsdDQAAAH4AbABpAGIALwBhAHIAcgBhAHkALgB0AHMAQcAACzkbAAAAfgBsAGkAYgAvAGkAbgB0AGUAcgBuAGEAbAAvAHQAeQBwAGUAZABhAHIAcgBhAHkALgB0AHMAQYABCzMYAAAAcwByAGMALwBsAHoAbQBhAC8AbAB6AG0AYQAtAGQAZQBjAG8AZABlAHIALgB0AHM=")}.toString(),")();\n return function(data, callback) {\n return (").concat(function(e,t,n){try{var i=new WebAssembly.Memory({initial:16}),r=new WebAssembly.Module(e),o=new WebAssembly.Instance(r,{env:{memory:i,abort:function(){n(new Error("webAssembly abort"))}}}).exports,a=o.newU8Array(t.length);new Uint8Array(i.buffer,a+24,t.length).set(t);var s=o.decode(a),l=new Uint32Array(i.buffer,s,4),c=l[0],u=l[2],h=l[3];c?n(null,new Uint8Array(i.buffer,h+24,u).slice(0,u)):n(new Error("lzma deocder error"))}catch(e){n(e)}}.toString(),')(LZMA_WASM, data, callback);\n }\n})();\n\nself.onmessage = function(event) {\n var packet = event.data;\n if (!packet.id) {\n postMessage({ id: packet.id, error: "No incoming id." });\n return;\n }\n if (!packet.data) {\n postMessage({ id: packet.id, error: "No input data." });\n return;\n }\n if (packet.type == "decompress") {\n if (packet.data.constructor !== Uint8Array) {\n postMessage({ id: packet.id, error: "Input data is not Uint8Array." });\n }\n const callback = function(error, result) {\n if (error) {\n postMessage({ id: packet.id, error: error.toString() });\n } else {\n postMessage({ id: packet.id, result: result, error: null }, [ result.buffer ]);\n }\n }\n if (typeof WebAssembly !== "undefined" && WebAssembly.instantiate) {\n decodeLZMAWithWASM(packet.data, callback);\n } else {\n decodeLZMA(packet.data, callback);\n }\n return;\n }\n postMessage({ id: packet.id, error: "type never matched." });\n};\n'),rn="undefined"!=typeof Worker&&"undefined"!=typeof Blob,on="";if(rn)try{var an=new Blob([nn],{type:"text/javascript"});on=URL.createObjectURL(an)}catch(e){}var sn=function(){function e(){var e=this;if(!rn)throw new Error("LZMAWorker cannot work in this broswer.");this.callCounter=0,this.requests={};var t=this.worker=new Worker(on);t.onmessage=function(t){var n=t.data,i=n.id,r=n.result,o=n.error,a=e.getKey(i);e.requests[a]&&(o?e.requests[a](new Error(o)):e.requests[a](null,r),delete e.requests[a])},t.onerror=function(e){return console.error(e)}}return e.prototype.getKey=function(e){return"key_"+String(e)},e.prototype.decompress=function(e,t){var n=++this.callCounter;this.requests[this.getKey(n)]=t,this.worker.postMessage({type:"decompress",id:n,data:e},[e.buffer])},e.prototype.terminate=function(){this.worker.terminate()},e.support=rn,e}();function ln(e){return Array.prototype.reduce.call(e,(function(e,t,n){return e|t<<8*n}),0)}function cn(e){var t=new Uint8Array(e),n=ln(t.slice(0,4));if(n>10)return Promise.reject(new Error("LZMA got too many sub chunks."));for(var i=[],r=[],o=4+4*n,a=0;a<n;a++)r[a]=ln(t.slice(4+4*a,8+4*a)),i[a]=a===n-1?t.subarray(o,o+r[a]):t.slice(o,o+r[a]),o+=r[a];return sn.support?function(e){for(var t=[],n=e.length,i=function(n){t.push(new Promise((function(t,i){var r=new sn;r.decompress(e[n],(function(e,n){if(r.terminate(),e)return i(e);t(n)}))})))},r=0;r<n;r++)i(r);return Promise.all(t)}(i):Promise.resolve(function(e){for(var t,n=[],i=e.length,r=function(i){var r={data:e[i],offset:0,readByte:function(){return this.data[this.offset++]}},o=r.data.length,a={data:[],offset:0,writeByte:function(e){var t=Math.floor(this.offset/o);this.data[t]||(this.data[t]=new Uint8Array(o)),this.data[t][this.offset%o]=e,this.offset++}};tn.decompressFile(r,a),t=new Uint8Array(a.offset);for(var s=0;s<a.offset;s++)t[s]=a.data[Math.floor(s/o)][s%o];n.push(t)},o=0;o<i;o++)r(o);return n}(i))}function un(e,t){for(var n={},i=0,r=t;i<r.length;i++){var o=r[i];o in e&&(n[o]=e[o])}return n}function hn(e,t){void 0===t&&(t=!1);var n=typeof e;if("string"===n)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 i="[",r=e.length-1,o=0;o<r;o++)i+=hn(e[o],!1)+",";return r>-1&&(i+=hn(e[o],!1)),i+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return hn(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(i="",o=0;o<s;){var l=a[o],c=hn(e[l],!0);void 0!==c&&(o&&""!==i&&(i+=","),i+=JSON.stringify(l)+":"+c),o++}return"{"+i+"}"}switch(n){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 dn(e){return"hash::".concat(hn(e,!1))}var pn=new i.WebGLRenderTarget(1,1),fn=new i.OrthographicCamera(-1,1,1,-1,0,1);fn.matrixAutoUpdate=!1;var An=new i.BufferGeometry;An.setAttribute("position",new i.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));var vn=new i.Mesh(An);vn.matrixAutoUpdate=!1;var mn=new i.Scene;mn.add(vn),mn.matrixAutoUpdate=!1;var gn=new i.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform sampler2D map;\n void main() {\n gl_FragColor = texture2D(map, vec2(0, 0));\n }\n ",depthTest:!1,depthWrite:!1,stencilWrite:!1,colorWrite:!1,blending:i.NoBlending,lights:!1,toneMapped:!1}),yn=new i.RawShaderMaterial({uniforms:{map:{value:null}},vertexShader:"\n void main() {\n gl_Position = vec4(0, 0, 0, 0);\n }\n ",fragmentShader:"\n uniform samplerCube map;\n void main() {\n gl_FragColor = textureCube(map, vec3(0, 0, 0));\n }\n ",depthTest:!1,depthWrite:!1,stencilWrite:!1,blending:i.NoBlending,lights:!1,toneMapped:!1}),bn=Promise.resolve();function xn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[];e=e.map((function(e){return(null!=e?e:"").trim()})).filter((function(e){return e.length>0&&!/^\/+$/.test(e)}));for(var i=0;i<e.length;i++){var r=0===i,o=i===e.length-1,a=e[i];r||(a=a.replace(/^\/+/,"")),o||(a=a.replace(/\/+$/,"")),n.push(a)}return n.join("/")}const wn=r.Reader,Mn=r.util,Cn=r.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]||(r.roots["@REALSEE/FIVE:five/loaders/model/proto/pbm.proto"]={}),En=Cn.Model=(()=>{function e(e){if(this.chunks=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.chunks=Mn.emptyArray,e.prototype.createAt=Mn.Long?Mn.Long.fromBits(0,0,!0):0,e.prototype.description="",e.decode=function(e,t){e instanceof wn||(e=wn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Cn.Model;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.chunks&&i.chunks.length||(i.chunks=[]),i.chunks.push(Cn.Chunk.decode(e,e.uint32()));break;case 2:i.createAt=e.uint64();break;case 3:i.description=e.string();break;default:e.skipType(7&t)}}return i},e})();Cn.Chunk=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.vertices=null,e.prototype.faces=null,e.prototype.name="",e.prototype.texture="",e.decode=function(e,t){e instanceof wn||(e=wn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Cn.Chunk;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.vertices=Cn.Vertices.decode(e,e.uint32());break;case 2:i.faces=Cn.Faces.decode(e,e.uint32());break;case 3:i.name=e.string();break;case 4:i.texture=e.string();break;default:e.skipType(7&t)}}if(!i.hasOwnProperty("vertices"))throw Mn.ProtocolError("missing required 'vertices'",{instance:i});if(!i.hasOwnProperty("faces"))throw Mn.ProtocolError("missing required 'faces'",{instance:i});if(!i.hasOwnProperty("name"))throw Mn.ProtocolError("missing required 'name'",{instance:i});return i},e})(),Cn.Vertices=(()=>{function e(e){if(this.xyz=[],this.uvs=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.xyz=Mn.emptyArray,e.prototype.uvs=Mn.emptyArray,e.decode=function(e,t){e instanceof wn||(e=wn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Cn.Vertices;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:if(i.xyz&&i.xyz.length||(i.xyz=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.xyz.push(e.float())}else i.xyz.push(e.float());break;case 2:if(i.uvs&&i.uvs.length||(i.uvs=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.uvs.push(e.float())}else i.uvs.push(e.float());break;default:e.skipType(7&t)}}return i},e})(),Cn.Faces=(()=>{function e(e){if(this.indices=[],this.normals=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.indices=Mn.emptyArray,e.prototype.normals=Mn.emptyArray,e.decode=function(e,t){e instanceof wn||(e=wn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Cn.Faces;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:if(i.indices&&i.indices.length||(i.indices=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.indices.push(e.uint32())}else i.indices.push(e.uint32());break;case 2:if(i.normals&&i.normals.length||(i.normals=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.normals.push(e.float())}else i.normals.push(e.float());break;default:e.skipType(7&t)}}return i},e})();var In=(new i.Matrix4).set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1).elements;function Sn(e){var t=e.match(/(group|floor)-?(\d+)/);return t?parseInt(t[2],10):0}function Bn(e){var t=e.match(/(chunk)-?(\d+)/);return t?parseInt(t[2],10):0}function Tn(e){var t=Sn(e.name),n=Bn(e.name),i=function(e){var t=e.match(/(sub)-?(\d+)/);return t?parseInt(t[2],10):0}(e.name);return 1e6*t+1e3*n+i}function Pn(e,t,n,r,o,a){var s=re({key:"texture.pbm"},un(t,["format","quality","size","sharpen","mappings"])),l=new Mt({allowHosts:n,requestProxy:r,networkSubscribe:o}).loadTexture(e,{imageURL:{transform:t.transform,options:s},wrapS:i.ClampToEdgeWrapping,wrapT:i.ClampToEdgeWrapping,minFilter:i.LinearFilter,maxSize:"number"==typeof s.size?new i.Vector2(s.size,s.size):void 0}).then((function(e){var t=e.body;return t.needsUpdate=!0,function(e,t){if(!t)return Promise.resolve(e);var n=t.getRenderTarget();t.setRenderTarget(pn),e instanceof i.CubeTexture?(vn.material=yn,yn.uniforms.map.value=e,t.render(mn,fn),yn.uniforms.map.value=null):(vn.material=gn,gn.uniforms.map.value=e,t.render(mn,fn),yn.uniforms.map.value=null),t.setRenderTarget(n);var r=bn.then((function(){return new Promise((function(t){Fe.shared.add((function(){t(e)}),!0)}))}));return bn=r.catch((function(){})),r}(t,a)}));return Object.assign(l,{url:e,textureOptions:t})}function Rn(e,t,n,r,o,a,s,l,c){void 0===o&&(o={});for(var u=function(e){for(var t,n,i,r="number"==typeof e.createAt?e.createAt:null===e.createAt||void 0===e.createAt?0:e.createAt.toNumber(),o=null!==(t=e.description)&&void 0!==t?t:"",a=[],s=!0,l=0,c=e.chunks;l<c.length;l++)if(!(ne=c[l]).faces.normals||0===ne.faces.normals.length){s=!1;break}for(var u=e.chunks.sort((function(e,t){return Tn(e)-Tn(t)})),h=[],d=0,p=u;d<p.length;d++){var f=Sn((ne=p[d]).name);h[f]||(h[f]=[]),h[f].push(ne)}for(var A=0;A<h.length;A++){var v=h[A];if(v)if(s){for(var m=0,g=0;g<v.length;g++)m+=(ne=v[g]).faces.indices.length;for(var y=3*m,b=2*m,x=3*m,w=new ArrayBuffer(4*y+4*b+4*x),M=new Float32Array(w,0,y),C=new Float32Array(w,4*y,b),E=new Float32Array(w,4*y+4*b,x),I=[],S=[1/0,1/0,1/0,-1/0,-1/0,-1/0],B=0,T=0;T<v.length;T++){var P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],R=(ne=v[T]).vertices.xyz,L=ne.vertices.uvs,O=ne.faces.indices,F=ne.faces.normals,k=O.length;for(g=0;g<k;g++){var D=O[g],Q=R[3*D],N=R[3*D+1],V=R[3*D+2],U=1/(In[3]*Q+In[7]*N+In[11]*V+In[15]),z=(In[0]*Q+In[4]*N+In[8]*V+In[12])*U,q=(In[1]*Q+In[5]*N+In[9]*V+In[13])*U,H=(In[2]*Q+In[6]*N+In[10]*V+In[14])*U;M[3*B+3*g]=z,M[3*B+3*g+1]=q,M[3*B+3*g+2]=H,C[2*B+2*g]=L[2*D],C[2*B+2*g+1]=L[2*D+1];var _=3*Math.floor(g/3),j=F[_],K=F[_+1],G=F[_+2],W=1/(In[3]*j+In[7]*K+In[11]*G+In[15]),X=(In[0]*j+In[4]*K+In[8]*G+In[12])*W,Y=(In[1]*j+In[5]*K+In[9]*G+In[13])*W,Z=(In[2]*j+In[6]*K+In[10]*G+In[14])*W;E[3*B+3*g]=X,E[3*B+3*g+1]=Y,E[3*B+3*g+2]=Z,z<P[0]&&(P[0]=z),q<P[1]&&(P[1]=q),H<P[2]&&(P[2]=H),z>P[3]&&(P[3]=z),q>P[4]&&(P[4]=q),H>P[5]&&(P[5]=H)}P[0]<S[0]&&(S[0]=P[0]),P[1]<S[1]&&(S[1]=P[1]),P[2]<S[2]&&(S[2]=P[2]),P[3]>S[3]&&(S[3]=P[3]),P[4]>S[4]&&(S[4]=P[4]),P[5]>S[5]&&(S[5]=P[5]),I.push({materialIndex:T,name:ne.name,chunkName:Bn(ne.name),start:B,count:ne.faces.indices.length,texture:null!==(n=ne.texture)&&void 0!==n?n:void 0}),B+=k}a.push({createAt:r,description:o,floorIndex:A,vertices:M,uvs:C,indices:null,normals:E,groups:I,extents:S})}else{m=0;var J=0;for(g=0;g<v.length;g++)J+=(ne=v[g]).vertices.xyz.length/3,m+=ne.faces.indices.length;y=3*J,b=2*J,x=3*J;var $=m,ee=(w=new ArrayBuffer(4*y+4*b+4*x+4*$),M=new Float32Array(w,0,y),C=new Float32Array(w,4*y,b),E=new Float32Array(w,4*y+4*b,x),new Uint32Array(w,4*y+4*b+4*x,$)),te=(I=[],S=[1/0,1/0,1/0,-1/0,-1/0,-1/0],0);for(B=0,T=0;T<v.length;T++){P=[1/0,1/0,1/0,-1/0,-1/0,-1/0],R=(ne=v[T]).vertices.xyz,L=ne.vertices.uvs,O=ne.faces.indices;var ne,ie=R.length/3;for(k=O.length,g=0;g<ie;g++)Q=R[3*g],N=R[3*g+1],V=R[3*g+2],U=1/(In[3]*Q+In[7]*N+In[11]*V+In[15]),z=(In[0]*Q+In[4]*N+In[8]*V+In[12])*U,q=(In[1]*Q+In[5]*N+In[9]*V+In[13])*U,H=(In[2]*Q+In[6]*N+In[10]*V+In[14])*U,M[3*B+3*g]=z,M[3*B+3*g+1]=q,M[3*B+3*g+2]=H,C[2*B+2*g]=L[2*g],C[2*B+2*g+1]=L[2*g+1],z<P[0]&&(P[0]=z),q<P[1]&&(P[1]=q),H<P[2]&&(P[2]=H),z>P[3]&&(P[3]=z),q>P[4]&&(P[4]=q),H>P[5]&&(P[5]=H);for(P[0]<S[0]&&(S[0]=P[0]),P[1]<S[1]&&(S[1]=P[1]),P[2]<S[2]&&(S[2]=P[2]),P[3]>S[3]&&(S[3]=P[3]),P[4]>S[4]&&(S[4]=P[4]),P[5]>S[5]&&(S[5]=P[5]),g=0;g<k;g++)ee[te+g]=B+O[g];I.push({materialIndex:T,name:ne.name,chunkName:Bn(ne.name),start:te,count:ne.faces.indices.length,texture:null!==(i=ne.texture)&&void 0!==i?i:void 0}),B+=ie,te+=k}for(g=0;g<m;g+=3){var re,oe,ae,se,le,ce,ue,he,de,pe,fe,Ae,ve,me,ge,ye;j=void 0,K=void 0,G=void 0,re=3*ee[g],oe=3*ee[g+1],ae=3*ee[g+2],se=M[re],le=M[re+1],ce=M[re+2],ue=M[oe],he=M[oe+1],de=M[oe+2],pe=M[ae],j=(Ae=M[ae+1]-he)*(ye=ce-de)-(ve=M[ae+2]-de)*(ge=le-he),K=ve*(me=se-ue)-(fe=pe-ue)*ye,G=fe*ge-Ae*me,E[re]+=j,E[re+1]+=K,E[re+2]+=G,E[oe]+=j,E[oe+1]+=K,E[oe+2]+=G,E[ae]+=j,E[ae+1]+=K,E[ae+2]+=G}a.push({createAt:r,description:o,floorIndex:A,vertices:M,uvs:C,indices:ee,normals:E,groups:I,extents:S})}}return a}(e),h=0,d="",p=[],f={},A=0,v=u;A<v.length;A++){var m=v[A],g=m.createAt,y=m.description,b=m.floorIndex,x=m.vertices,w=m.uvs,M=m.indices,C=m.normals,E=m.groups,I=m.extents,S=new i.Box3;S.min.x=I[0],S.min.y=I[1],S.min.z=I[2],S.max.x=I[3],S.max.y=I[4],S.max.z=I[5];var B=new i.BufferGeometry;B.setAttribute("position",new i.BufferAttribute(x,3)),B.setAttribute("uv",new i.BufferAttribute(w,2)),B.setAttribute("normal",new i.BufferAttribute(C,3)),M&&B.setIndex(new i.BufferAttribute(M,1)),B.boundingBox=S,B.boundingSphere=S.getBoundingSphere(new i.Sphere);for(var T=0,P=E;T<P.length;T++){var R=P[T];B.addGroup(R.start,R.count,R.materialIndex)}for(var L=[],O=0,F=E;O<F.length;O++){R=F[O];var k=n[R.chunkName]||(R.texture?xn(t,R.texture):void 0),D=new Bt;L.push(D),k?f[k]?f[k].push(D):f[k]=[D]:(D.defines.USE_MAP=!1,D.uniforms.diffuse.value=new i.Color(16777215)),D.uniforms.floorIndex.value=b}var Q=new je(B,L);Q.name="model_floor_"+b,Q.floorIndex=b,Q.userData.createAt=g,Q.userData.description=y,h=g,d=y,p.push(Q)}var N="",V=function(e){e=Ln(e,n.length);var t=[],r=dn(e);if(N===r)return Promise.resolve();N=r;for(var u=function(n){var u=null;n in o&&(dn(o[n].textureOptions)===dn(e)?u=o[n]:o[n].then((function(e){return e.dispose()}))),u||(u=Pn(n,e,a,s,l,c)),t.push(u.then((function(e){if(N===r)for(var t=0,i=f[n];t<i.length;t++){var o=i[t];o.uniforms.map.value&&o.uniforms.map.value.dispose(),o.uniforms.map.value=e,o.uniforms.exposure.value=3.3}else e.dispose()})).catch((function(){if(N===r)for(var e=0,t=f[n];e<t.length;e++){var o=t[e];o.uniforms.map.value&&o.uniforms.map.value.dispose(),o.uniforms.map.value=null,o.defines.USE_MAP=!1,o.uniforms.diffuse.value=new i.Color(16777215)}})))},h=0,d=Object.keys(f);h<d.length;h++){u(p=d[h])}for(var p in o)delete o[p];return Promise.all(t).then((function(){}))};return{createAt:h,description:d,objects:p,texturePromise:V(r),updateTexture:V}}function Ln(e,t){return!1!==(e=Object.assign({},e)).autoResize&&(t>96?e.size=Math.min(e.size||1/0,100):t>48?e.size=Math.min(e.size||1/0,200):t>24?e.size=Math.min(e.size||1/0,400):t>22?e.size=Math.min(e.size||1/0,800):t>5&&(e.size=Math.min(e.size||1/0,1024))),e}function On(e){return 0===e.indexOf("//")||/^[0-9a-z]+\:/i.test(e)}const Fn=r.Reader,kn=r.util,Dn=r.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]||(r.roots["@REALSEE/FIVE:five/loaders/model/proto/dome.proto"]={}),Qn=Dn.Model=(()=>{function e(e){if(this.meshes=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.meshes=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Model;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)i.meshes&&i.meshes.length||(i.meshes=[]),i.meshes.push(Dn.Mesh.decode(e,e.uint32()));else e.skipType(7&t)}return i},e})();function Nn(e){for(var t=[0,0,0],n=0;n<e.attributes.normal.array.length/9;n++)t[0]=e.attributes.normal.array[9*n],t[1]=e.attributes.normal.array[9*n+1],t[2]=e.attributes.normal.array[9*n+2],e.attributes.normal.array[9*n]=e.attributes.normal.array[9*n+6],e.attributes.normal.array[9*n+1]=e.attributes.normal.array[9*n+7],e.attributes.normal.array[9*n+2]=e.attributes.normal.array[9*n+8],e.attributes.normal.array[9*n+6]=t[0],e.attributes.normal.array[9*n+7]=t[1],e.attributes.normal.array[9*n+8]=t[2];for(n=0;n<e.attributes.position.array.length/9;n++)t[0]=e.attributes.position.array[9*n],t[1]=e.attributes.position.array[9*n+1],t[2]=e.attributes.position.array[9*n+2],e.attributes.position.array[9*n]=e.attributes.position.array[9*n+6],e.attributes.position.array[9*n+1]=e.attributes.position.array[9*n+7],e.attributes.position.array[9*n+2]=e.attributes.position.array[9*n+8],e.attributes.position.array[9*n+6]=t[0],e.attributes.position.array[9*n+7]=t[1],e.attributes.position.array[9*n+8]=t[2];for(n=0;n<e.attributes.uv.array.length/6;n++)t[0]=e.attributes.uv.array[6*n],t[1]=e.attributes.uv.array[6*n+1],e.attributes.uv.array[6*n]=e.attributes.uv.array[6*n+4],e.attributes.uv.array[6*n+1]=e.attributes.uv.array[6*n+5],e.attributes.uv.array[6*n+4]=t[0],e.attributes.uv.array[6*n+5]=t[1];e.attributes.normal.needsUpdate=!0,e.attributes.position.needsUpdate=!0,e.attributes.uv.needsUpdate=!0}function Vn(e){var t=e.position,n=e.normal,r=e.uv,o=e.uv2,a=e.groups,s=new i.BufferGeometry;s.setAttribute("position",new i.BufferAttribute(new Float32Array(t.array),3)),n&&s.setAttribute("normal",new i.BufferAttribute(new Float32Array(n.array),3)),r&&s.setAttribute("uv",new i.BufferAttribute(new Float32Array(r.array),2)),o&&s.setAttribute("uv2",new i.BufferAttribute(new Float32Array(o.array),2));for(var l=0,c=a;l<c.length;l++){var u=c[l];s.addGroup(u.start,u.count,u.materialIndex)}return s}function Un(e,t,n,r,o,a){if(a.hasOwnProperty(e))return a[e];On(e=e.split("?")[0])||(e=xn(t,e)),0===(e=e.replace(/\/\/vrlab-image\d*.ljcdn.com\//,"//vrlab-public.ljcdn.com/")).indexOf("//")&&(e="https:"+e);var s=re({key:"texture.dome",size:64},un(n,["quality","format","sharpen","mappings"]));return a[e]=o.loadTexture(e,{imageURL:{transform:n.transform,options:s},wrapS:i.RepeatWrapping,wrapT:i.RepeatWrapping}).then((function(e){var t=e.body;return r&&t.repeat.copy(r),t.needsUpdate=!0,t.updateMatrix(),t}))}function zn(e,t,n,r,o){var a=[],s=new Bt,l=s.uniforms;l.exposure.value=4.3;var c=s.defines;if(c.USE_MAP=!1,c.USE_UV=!1,e.kd&&(l.diffuse.value=(new i.Color).fromArray(e.kd.rgb)),e.mapkd){var u=null;if(e.mapkdrepeat){var h=e.mapkdrepeat.split(/\s+/).map((function(e){return Number(e)})),d=h[0],p=h[1];u=new i.Vector2(d,p)}a.push(Un(e.mapkd,t,n,u,r,o).then((function(e){c.USE_MAP=!0,c.USE_UV=!0,l.map.value=e,l.uvTransform.value=e.matrix,s.needsUpdate=!0})).catch(ue))}if(e.ks&&(l.specular.value=(new i.Color).fromArray(e.ks.rgb)),e.mapks&&a.push(Un(e.mapks,t,n,null,r,o).then((function(e){l.specularMap.value=e})).catch(ue)),e.ke&&(l.emissive.value=(new i.Color).fromArray(e.ke.rgb)),e.mapke&&a.push(Un(e.mapke,t,n,null,r,o).then((function(e){l.emissiveMap.value=e})).catch(ue)),e.norm&&a.push(Un(e.norm,t,n,null,r,o).then((function(e){l.normalMap.value=e})).catch(ue)),e.mapbump&&a.push(Un(e.mapbump,t,n,null,r,o).then((function(e){l.bumpMap.value=e})).catch(ue)),e.bump&&a.push(Un(e.bump,t,n,null,r,o).then((function(e){l.bumpMap.value=e})).catch(ue)),"number"==typeof e.ns&&(l.shininess.value=e.ns),"number"==typeof e.d){var f=e.d;f>0&&f<1&&(s.originOpacity=f,s.opacity=f)}return{material:s,textureReady:Promise.all(a).then(ue)}}function qn(e,t,n,r,o,a){for(var s,l=[],c=[],u=(s=e,Qn.decode(s).meshes),h=new Mt({allowHosts:r,requestProxy:o,networkSubscribe:a}),d=new i.Matrix4,p=new i.Vector3,f=new i.Quaternion,A=new i.Vector3,v={},m=0,g=u;m<g.length;m++){var y=g[m],b=y.name,x=y.chunks,w=y.matrix;if("Ceiling"!==b&&"CeilingDrop"!==b)for(var M=0,C=w;M<C.length;M++){var E=C[M];d.elements=E.elements;var I=new Ge;I.renderOrder=-4;for(var S=0;S<x.length;S++){var B=Vn(x[S].geometry);B.applyMatrix4(d),d.decompose(p,f,A),A.x*A.y*A.z<0&&B.attributes.normal&&B.attributes.position&&B.attributes.uv&&Nn(B);for(var T=[],P=0,R=x[S].material;P<R.length;P++){var L=zn(R[P],t,n,h,v),O=L.material,F=L.textureReady;c.push(F),T.push(O)}var k=new je(B,T);k.name="chunk_"+S,I.add(k)}I.floorIndex=0,I.name=b,l.push(I)}}return{createAt:0,description:"",objects:l,texturePromise:Promise.all(c).catch(ue),updateTexture:function(e){return Promise.resolve()}}}Dn.Mesh=(()=>{function e(e){if(this.chunks=[],this.matrix=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.name="",e.prototype.chunks=kn.emptyArray,e.prototype.matrix=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Mesh;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.name=e.string();break;case 2:i.chunks&&i.chunks.length||(i.chunks=[]),i.chunks.push(Dn.Chunk.decode(e,e.uint32()));break;case 3:i.matrix&&i.matrix.length||(i.matrix=[]),i.matrix.push(Dn.Matrix.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!i.hasOwnProperty("name"))throw kn.ProtocolError("missing required 'name'",{instance:i});return i},e})(),Dn.Matrix=(()=>{function e(e){if(this.elements=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.elements=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Matrix;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)if(i.elements&&i.elements.length||(i.elements=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.elements.push(e.float())}else i.elements.push(e.float());else e.skipType(7&t)}return i},e})(),Dn.Chunk=(()=>{function e(e){if(this.material=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.geometry=null,e.prototype.material=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Chunk;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 2:i.geometry=Dn.Geometry.decode(e,e.uint32());break;case 3:i.material&&i.material.length||(i.material=[]),i.material.push(Dn.Material.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!i.hasOwnProperty("geometry"))throw kn.ProtocolError("missing required 'geometry'",{instance:i});return i},e})(),Dn.Geometry=(()=>{function e(e){if(this.groups=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.position=null,e.prototype.uv=null,e.prototype.uv2=null,e.prototype.normal=null,e.prototype.groups=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Geometry;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.position=Dn.Position.decode(e,e.uint32());break;case 2:i.uv=Dn.UV.decode(e,e.uint32());break;case 3:i.uv2=Dn.UV.decode(e,e.uint32());break;case 4:i.normal=Dn.Normal.decode(e,e.uint32());break;case 5:i.groups&&i.groups.length||(i.groups=[]),i.groups.push(Dn.Group.decode(e,e.uint32()));break;default:e.skipType(7&t)}}if(!i.hasOwnProperty("position"))throw kn.ProtocolError("missing required 'position'",{instance:i});if(!i.hasOwnProperty("normal"))throw kn.ProtocolError("missing required 'normal'",{instance:i});return i},e})(),Dn.Position=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.array=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Position;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)if(i.array&&i.array.length||(i.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.array.push(e.float())}else i.array.push(e.float());else e.skipType(7&t)}return i},e})(),Dn.UV=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.array=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.UV;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)if(i.array&&i.array.length||(i.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.array.push(e.float())}else i.array.push(e.float());else e.skipType(7&t)}return i},e})(),Dn.Normal=(()=>{function e(e){if(this.array=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.array=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Normal;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)if(i.array&&i.array.length||(i.array=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.array.push(e.float())}else i.array.push(e.float());else e.skipType(7&t)}return i},e})(),Dn.Group=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.start=0,e.prototype.count=0,e.prototype.materialIndex=0,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Group;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.start=e.uint32();break;case 2:i.count=e.uint32();break;case 3:i.materialIndex=e.uint32();break;default:e.skipType(7&t)}}if(!i.hasOwnProperty("start"))throw kn.ProtocolError("missing required 'start'",{instance:i});if(!i.hasOwnProperty("count"))throw kn.ProtocolError("missing required 'count'",{instance:i});if(!i.hasOwnProperty("materialIndex"))throw kn.ProtocolError("missing required 'materialIndex'",{instance:i});return i},e})(),Dn.Material=(()=>{function e(e){if(e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.kd=null,e.prototype.ks=null,e.prototype.ke=null,e.prototype.mapkd="",e.prototype.mapks="",e.prototype.mapke="",e.prototype.norm="",e.prototype.mapbump="",e.prototype.bump="",e.prototype.mapd="",e.prototype.ns=0,e.prototype.d=0,e.prototype.tr=0,e.prototype.mapkdrepeat="",e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Material;for(;e.pos<n;){let t=e.uint32();switch(t>>>3){case 1:i.kd=Dn.Color.decode(e,e.uint32());break;case 2:i.ks=Dn.Color.decode(e,e.uint32());break;case 3:i.ke=Dn.Color.decode(e,e.uint32());break;case 4:i.mapkd=e.string();break;case 5:i.mapks=e.string();break;case 6:i.mapke=e.string();break;case 7:i.norm=e.string();break;case 8:i.mapbump=e.string();break;case 9:i.bump=e.string();break;case 10:i.mapd=e.string();break;case 11:i.ns=e.float();break;case 12:i.d=e.float();break;case 13:i.tr=e.float();break;case 14:i.mapkdrepeat=e.string();break;default:e.skipType(7&t)}}return i},e})(),Dn.Color=(()=>{function e(e){if(this.rgb=[],e)for(let t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.rgb=kn.emptyArray,e.decode=function(e,t){e instanceof Fn||(e=Fn.create(e));let n=void 0===t?e.len:e.pos+t,i=new Dn.Color;for(;e.pos<n;){let t=e.uint32();if(t>>>3==1)if(i.rgb&&i.rgb.length||(i.rgb=[]),2==(7&t)){let t=e.uint32()+e.pos;for(;e.pos<t;)i.rgb.push(e.float())}else i.rgb.push(e.float());else e.skipType(7&t)}return i},e})();var Hn={throttleRequests:!0,maxRequests:5},_n=function(){function e(e){void 0===e&&(e={}),this.props=re(re({},Hn),e),this.activeRequestCount=0,this.requestQueue=[],this.requestMap=new Map,this.deferred=null}return e.prototype.scheduleRequest=function(e,t){if(void 0===t&&(t=function(){return 0}),!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(e))return this.requestMap.get(e);var n={identiy:e,priority:0,getPriority:t,resolve:function(){}},i=new Promise((function(e){return n.resolve=e}));return this.requestQueue.push(n),this.requestMap.set(e,i),this.issueNewRequests(),i},e.prototype.issueRequest=function(e){var t=this,n=e.identiy,i=e.resolve,r=!1;this.activeRequestCount++,i({done:function(){r||(r=!0,t.requestMap.delete(n),t.activeRequestCount--,t.issueNewRequests())}})},e.prototype.issueNewRequests=function(){var e=this;this.deferred||(this.deferred=setTimeout((function(){return e.issueNewRequestsAsync()}),0))},e.prototype.issueNewRequestsAsync=function(){this.deferred=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==e){this.updateAllRequests();for(var t=0;t<e;t++){var n=this.requestQueue.shift();n&&this.issueRequest(n)}}},e.prototype.updateAllRequests=function(){for(var e=this.requestQueue,t=0;t<e.length;t++){var n=e[t];this.updateRequest(n)||(e.splice(t,1),this.requestMap.delete(n.identiy),t--)}e.sort((function(e,t){return e.priority-t.priority}))},e.prototype.updateRequest=function(e){return e.priority=e.getPriority(e.identiy),!(e.priority<0)||(e.resolve(null),!1)},e}(),jn=function(e,t,n){this.item=e,this.previous=t,this.next=n},Kn=function(){function e(){this.head=null,this.tail=null,this._length=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),e.prototype.add=function(e){var t=new jn(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),this._length++,t},e.prototype.remove=function(e){e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,this._length--},e.prototype.splice=function(e,t){e!==t&&(this.remove(t),this.insert(e,t))},e.prototype.insert=function(e,t){var n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,this._length++},e.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},e}(),Gn=function(){function e(){this.list=new Kn,this.sentinel=this.list.add("sentinel")}return e.prototype.reset=function(){this.list.splice(this.list.tail,this.sentinel)},e.prototype.touch=function(e){var t=e.cacheNode;t&&this.list.splice(this.sentinel,t)},e.prototype.add=function(e,t){e.cacheNode||(e.cacheNode=this.list.add(e),t&&t(e))},e.prototype.unloadTile=function(e,t){var n=e.cacheNode;n&&(this.list.remove(n),e.cacheNode=void 0,t&&t(e))},e.prototype.unloadTiles=function(e,t){for(var n=this.list.head;n!==this.sentinel&&e();){var i=n.item;n=n.next,this.unloadTile(i,t)}},e.prototype.toArray=function(){for(var e=[],t=0,n=this.list.toArray();t<n.length;t++){var i=n[t];"sentinel"!==i.item&&e.push(i.item)}return e},e}(),Wn=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),Xn=[new e.Vector3(1,0,0),new e.Vector3(0,1,0),new e.Vector3(0,0,1)],Yn=new e.Vector3,Zn=new e.Vector3,Jn=function(){function t(e){void 0===e&&(e=[]),this.planes=e}return Object.defineProperty(t,"MASK_OUTSIDE",{get:function(){return 4294967295},enumerable:!1,configurable:!0}),Object.defineProperty(t,"MASK_INSIDE",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t,"MASK_INDETERMINATE",{get:function(){return 2147483647},enumerable:!1,configurable:!0}),t.prototype.fromBoundingSphere=function(t){this.planes.length=2*Xn.length;for(var n=t.center,i=t.radius,r=0,o=0,a=Xn;o<a.length;o++){var s=a[o],l=this.planes[r],c=this.planes[r+1];l||(l=this.planes[r]=new e.Plane),c||(c=this.planes[r+1]=new e.Plane);var u=Yn.copy(s).multiplyScalar(-i).add(n);l.setFromNormalAndCoplanarPoint(s,u);var h=Yn.copy(s).multiplyScalar(i).add(n),d=Zn.copy(s).negate();c.setFromNormalAndCoplanarPoint(d,h),r+=2}return this},t.prototype.computeVisibilityWithPlaneMask=function(e,n){if(n===t.MASK_OUTSIDE||n===t.MASK_INSIDE)return n;for(var i=t.MASK_INSIDE,r=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0==(n&a))){var s=r[o],l=e.intersectPlane(s);if(l===Wn.OUTSIDE)return t.MASK_OUTSIDE;l===Wn.INTERSECTING&&(i|=a)}}return i},t}();var $n=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),ei=new e.Vector3,ti=new e.Vector3,ni=function(){function t(t,n){void 0===t&&(t=[0,0,0]),void 0===n&&(n=0),this.radius=-0,this.center=new e.Vector3,this.fromCenterRadius(t,n)}return t.prototype.fromCenterRadius=function(e,t){return this.center.fromArray(e),this.radius=t,this},t.prototype.fromCornerPoints=function(t,n){var i=ei.fromArray(n);return this.center=(new e.Vector3).fromArray(t).add((new e.Vector3).fromArray(n)).multiplyScalar(.5),this.radius=this.center.distanceTo(i),this},t.prototype.equals=function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius},t.prototype.clone=function(){return new t(this.center.toArray(),this.radius)},t.prototype.union=function(e){var t=this.center,n=this.radius,i=e.center,r=e.radius,o=ei.copy(i).sub(t),a=o.length();if(n>=a+r)return this.clone();if(r>=a+n)return e.clone();var s=.5*(n+a+r);return ti.copy(o).multiplyScalar((-n+s)/a).add(t),this.center.copy(ti),this.radius=s,this},t.prototype.expand=function(e){var t=ei.fromArray(e).sub(this.center).length();return t>this.radius&&(this.radius=t),this},t.prototype.transform=function(e){this.center.applyMatrix4(e);var t,n,i,r,o,a,s,l,c,u,h,d=(t=ei.toArray(),n=e.toArray(),i=n[0],r=n[1],o=n[2],a=n[4],s=n[5],l=n[6],c=n[8],u=n[9],h=n[10],t[0]=Math.hypot(i,r,o),t[1]=Math.hypot(a,s,l),t[2]=Math.hypot(c,u,h),t);return this.radius=Math.max(d[0],Math.max(d[1],d[2]))*this.radius,this},t.prototype.distanceSquaredTo=function(e){var t=this.distanceTo(e);return t*t},t.prototype.distanceTo=function(e){var t=ei.fromArray(e).sub(this.center);return Math.max(0,t.length()-this.radius)},t.prototype.intersectPlane=function(e){var t=this.center,n=this.radius,i=e.normal.dot(t)+e.constant;return i<-n?$n.OUTSIDE:i<n?$n.INTERSECTING:$n.INSIDE},t}(),ii=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1}),ri=new e.Vector3,oi=new e.Vector3,ai=new e.Vector3,si=new e.Vector3,li=new e.Vector3,ci=new e.Vector3,ui=new e.Vector3,hi=0,di=1,pi=2,fi=3,Ai=4,vi=5,mi=6,gi=7,yi=8;function bi(t,n,i){void 0===i&&(i=new e.Vector3);for(var r=3*n,o=new Array(3),a=0;a<3;++a)o[a]=t.toArray()[r+a];return i.fromArray(o)}var xi=function(){function t(t,n){this.center=(new e.Vector3).fromArray(t),this.halfAxes=(new e.Matrix3).fromArray(n)}return t.prototype.clone=function(){return new t(this.center.toArray(),this.halfAxes.toArray())},t.prototype.equals=function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)},t.prototype.getBoundingSphere=function(e){void 0===e&&(e=new ni);var t=this.halfAxes,n=bi(t,0,ai),i=bi(t,1,si),r=bi(t,2,li),o=ri.copy(n).add(i).add(r);return e.center.copy(this.center),e.radius=o.length(),e},t.prototype.intersectPlane=function(e){var t=this.center,n=e.normal,i=this.halfAxes.toArray(),r=n.x,o=n.y,a=n.z,s=Math.abs(r*i[hi]+o*i[di]+a*i[pi])+Math.abs(r*i[fi]+o*i[Ai]+a*i[vi])+Math.abs(r*i[mi]+o*i[gi]+a*i[yi]),l=n.dot(t)+e.constant;return l<=-s?ii.OUTSIDE:l>=s?ii.INSIDE:ii.INTERSECTING},t.prototype.distanceTo=function(e){return Math.sqrt(this.distanceSquaredTo(e))},t.prototype.distanceSquaredTo=function(e){var t=oi.fromArray(e).sub(this.center),n=this.halfAxes,i=bi(n,0,ai),r=bi(n,1,si),o=bi(n,2,li),a=i.length(),s=r.length(),l=o.length();i.normalize(),r.normalize(),o.normalize();var c,u=0;return(c=Math.abs(t.dot(i))-a)>0&&(u+=c*c),(c=Math.abs(t.dot(r))-s)>0&&(u+=c*c),(c=Math.abs(t.dot(o))-l)>0&&(u+=c*c),u},t.prototype.computePlaneDistances=function(e,t,n){void 0===n&&(n=[-0,-0]);var i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=bi(a,0,ai),l=bi(a,1,si),c=bi(a,2,li),u=ci.copy(s).add(l).add(c).add(o),h=ui.copy(u).sub(e),d=t.dot(h);return i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(s).add(l).sub(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(s).sub(l).add(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),u.copy(o).add(s).sub(l).sub(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).sub(s).add(l).add(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).sub(s).add(l).sub(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).sub(s).sub(l).add(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),o.copy(u).sub(s).sub(l).sub(c),h.copy(u).sub(e),d=t.dot(h),i=Math.min(d,i),r=Math.max(d,r),n[0]=i,n[1]=r,n},t.prototype.transform=function(t){var n=(new e.Matrix4).fromArray(t);this.center.applyMatrix4(n);var i=bi(this.halfAxes,0,ai);i.applyMatrix4(n);var r=bi(this.halfAxes,1,si);r.applyMatrix4(n);var o=bi(this.halfAxes,2,li);return o.applyMatrix4(n),this.halfAxes=(new e.Matrix3).fromArray(oe(oe(oe([],i.toArray(),!0),r.toArray(),!0),o.toArray(),!0)),this},t}();function wi(e,t){var n=e[0],i=e[1],r=e[2],o=t[3]*n+t[7]*i+t[11]*r||1;return e[0]=(t[0]*n+t[4]*i+t[8]*r)/o,e[1]=(t[1]*n+t[5]*i+t[9]*r)/o,e[2]=(t[2]*n+t[6]*i+t[10]*r)/o,e}function Mi(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=e[0],l=e[1],c=e[2],u=r*c-o*l,h=o*s-i*c,d=i*l-r*s,p=r*d-o*h,f=o*u-i*d,A=i*h-r*u,v=2*a;return u*=v,h*=v,d*=v,p*=2,f*=2,A*=2,e[0]=(s+u+p)*n,e[1]=(l+h+f)*n,e[2]=(c+d+A)*n,e}function Ci(e,t){var n=e.box;if(n){var i=t.elements,r=[n[0],n[1],n[2]];wi(r,i);var o=void 0,a=void 0,s=void 0;if(10===n.length){var l=[n[6],n[7],n[8]];o=Mi([1,0,0],l,n[3]),a=Mi([0,1,0],l,n[4]),s=Mi([0,0,1],l,n[5])}else o=[n[3],n[4],n[5]],a=[n[6],n[7],n[8]],s=[n[9],n[10],n[11]];wi(o,i),wi(a,i),wi(s,i);var c=[o[0],o[1],o[2],a[0],a[1],a[2],s[0],s[1],s[2]];return new xi(r,c)}throw new Error("3D Tile: boundingVolume must only can be box")}function Ei(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){var n=e.dynamicScreenSpaceErrorComputedDensity,i=e.dynamicScreenSpaceErrorFactor,r=function(e,t){var n=e*t;return 1-Math.exp(-n*n)}(t,n)*i;return r}return 0}var Ii="undefined"!=typeof Worker,Si=function(){function e(){if(!Ii)throw new Error("B3dmWorker cannot work in this browser");var e=URL.createObjectURL(new Blob(['\n var SIZEOF_UINT32 = 4\n\n var getStringFromArrayBuffer = function(arrayBuffer, byteOffset, byteLength) {\n const textDecoder = new TextDecoder("utf8");\n const typedArray = new Uint8Array(arrayBuffer, byteOffset, byteLength);\n const string = textDecoder.decode(typedArray);\n return string;\n }\n\n var sliceArrayBuffer = function(arrayBuffer, byteOffset, byteLength) {\n const subArray =\n byteLength !== undefined\n ? new Uint8Array(arrayBuffer).subarray(byteOffset, byteOffset + byteLength)\n : new Uint8Array(arrayBuffer).subarray(byteOffset);\n const arrayCopy = new Uint8Array(subArray);\n return arrayCopy.buffer;\n }\n\n var parse3DTileHeaderSync = function(tile, arrayBuffer, byteOffset=0){\n const view = new DataView(arrayBuffer);\n tile.magic = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n tile.version = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n tile.byteLength = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n \n if (tile.version !== 1) {\n throw new Error("3D Tile Version ".concat(tile.version, " not supported"));\n }\n return byteOffset;\n }\n\n var parse3DTileTablesHeaderSync = function(tile, arrayBuffer, byteOffset=0) {\n const view = new DataView(arrayBuffer);\n let batchLength;\n tile.header = tile.header || {};\n let featureTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n let featureTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n let batchTableJsonByteLength = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n let batchTableBinaryByteLength = view.getUint32(byteOffset, true);\n byteOffset += SIZEOF_UINT32;\n\n if (batchTableJsonByteLength >= 570425344) {\n byteOffset -= SIZEOF_UINT32 * 2;\n batchLength = featureTableJsonByteLength;\n batchTableJsonByteLength = featureTableBinaryByteLength;\n batchTableBinaryByteLength = 0;\n featureTableJsonByteLength = 0;\n featureTableBinaryByteLength = 0;\n console.warn(\'b3dm tile in legacy format.\');\n } else if (batchTableBinaryByteLength >= 570425344) {\n byteOffset -= SIZEOF_UINT32;\n batchLength = batchTableJsonByteLength;\n batchTableJsonByteLength = featureTableJsonByteLength;\n batchTableBinaryByteLength = featureTableBinaryByteLength;\n featureTableJsonByteLength = 0;\n featureTableBinaryByteLength = 0;\n console.warn(\'b3dm tile in legacy format.\');\n }\n\n tile.header.featureTableJsonByteLength = featureTableJsonByteLength;\n tile.header.featureTableBinaryByteLength = featureTableBinaryByteLength;\n tile.header.batchTableJsonByteLength = batchTableJsonByteLength;\n tile.header.batchTableBinaryByteLength = batchTableBinaryByteLength;\n tile.header.batchLength = batchLength;\n return byteOffset;\n }\n\n var parse3DTileTablesSync = function(tile, arrayBuffer, byteOffset = 0) {\n byteOffset = parse3DTileFeatureTable(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileBatchTable(tile, arrayBuffer, byteOffset);\n return byteOffset;\n }\n\n var parse3DTileFeatureTable = function (tile, arrayBuffer, byteOffset = 0) {\n const {\n featureTableJsonByteLength,\n featureTableBinaryByteLength,\n batchLength\n } = tile.header;\n tile.featureTableJson = {\n BATCH_LENGTH: batchLength || 0\n };\n \n if (featureTableJsonByteLength > 0) {\n const featureTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, featureTableJsonByteLength);\n tile.featureTableJson = JSON.parse(featureTableString);\n }\n \n byteOffset += featureTableJsonByteLength;\n tile.featureTableBinary = new Uint8Array(arrayBuffer, byteOffset, featureTableBinaryByteLength);\n byteOffset += featureTableBinaryByteLength;\n return byteOffset;\n }\n\n var parse3DTileBatchTable = function(tile, arrayBuffer, byteOffset = 0) {\n const {\n batchTableJsonByteLength,\n batchTableBinaryByteLength\n } = tile.header;\n \n if (batchTableJsonByteLength > 0) {\n const batchTableString = getStringFromArrayBuffer(arrayBuffer, byteOffset, batchTableJsonByteLength);\n tile.batchTableJson = JSON.parse(batchTableString);\n byteOffset += batchTableJsonByteLength;\n \n if (batchTableBinaryByteLength > 0) {\n tile.batchTableBinary = new Uint8Array(arrayBuffer, byteOffset, batchTableBinaryByteLength);\n tile.batchTableBinary = new Uint8Array(tile.batchTableBinary);\n byteOffset += batchTableBinaryByteLength;\n }\n }\n \n return byteOffset;\n }\n\n var parse3DTileGLTFViewSync = function(tile, arrayBuffer, byteOffset = 0) {\n const gltfByteLength = tile.byteOffset + tile.byteLength - byteOffset;\n\n if (gltfByteLength === 0) {\n throw new Error("glTF byte length must be greater than 0.");\n }\n tile.rotateYtoZ = true;\n tile.gltfUpAxis = "Y";\n tile.gltfArrayBuffer = sliceArrayBuffer(arrayBuffer, byteOffset, gltfByteLength);\n tile.gltfByteOffset = 0;\n tile.gltfByteLength = gltfByteLength;\n\n if (byteOffset % 4 === 0) {\n\n } else {\n console.warn("".concat(tile.type, ": embedded glb is not aligned to a 4-byte boundary."));\n }\n\n return tile.byteOffset + tile.byteLength;\n }\n\n var parseBatchedModel3DTile = function(tile, arrayBuffer, byteOffset) {\n byteOffset = parse3DTileHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesHeaderSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileTablesSync(tile, arrayBuffer, byteOffset);\n byteOffset = parse3DTileGLTFViewSync(tile, arrayBuffer, byteOffset);\n \n const rctCenterJsonValue = tile.featureTableJson["RTC_CENTER"];\n if (rctCenterJsonValue && Number.isFinite(rctCenterJsonValue.byteOffset)) {\n tile.rtcCenter = new Float32Array(tile.featureTableBinary.buffer, tile.featureTableBinary.buffer.byteOffset + rctCenterJsonValue.byteOffset, 3);\n }\n \n return byteOffset;\n }\n\n self.onmessage = function(event) {\n const {id, buffer} = event.data\n try{\n const tile = { byteOffset: 0, type: "b3dm" };\n parseBatchedModel3DTile(tile, buffer, tile.byteOffset);\n self.postMessage({id, tile})\n }catch(err){\n console.error(err)\n }\n }\n \n'],{type:"text/javascript"}));this.worker=new Worker(e),this.worker.addEventListener("message",(function(e){Promise.resolve(e)}))}return Object.defineProperty(e,"shared",{get:function(){return this.instance||(this.instance=new e),this.instance},enumerable:!1,configurable:!0}),e.prototype.terminate=function(){this.worker.terminate()},e}(),Bi=function(){function t(t,n,i){this.header=n,this.tileset=t,this.parent=i,this.children=[],this.contentState="UNLOADED",this.transform=this.header.transform?(new e.Matrix4).fromArray(this.header.transform):new e.Matrix4;var r=this.parent&&this.parent.computedTransform?this.parent.computedTransform.clone():t.modelMatrix.clone();this.computedTransform=r.multiply(this.transform),this.boundingVolume=Ci(this.header.boundingVolume,this.computedTransform),this.depth=this.parent?this.parent.depth+1:0,this.distanceToCamera=0,this.centerZDepth=0,this.screenSpaceError=0,this.shouldRefine=!1,this.visibilityPlaneMask=Jn.MASK_INDETERMINATE,this.visible=!1,this.selectionDepth=0,this.frameNumber=0,this.touchedFrameNumber=0,this.selectedFrameNumber=0,this.requestedFrameNumber=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.header.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refine",{get:function(){return this.header.refine||this.parent&&this.parent.refine||"REPLACE"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.header.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentUrl",{get:function(){if(this.header.content.uri){var e=this.tileset.b3dmMapping.b3dm_url[this.header.content.uri];if(!/^https?\:\/\//.test(e)){e=/^\//.test(e)?e.slice(1):e;var t=this.tileset.b3dmMapping.b3dm_base_url;e=(t=/\/$/.test(t)?t:t+"/")+e}return Ue(e,{key:"model-".concat(this.siblingIndex)})}return this.header.contentUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"siblingIndex",{get:function(){var e;return null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodMetricType",{get:function(){return this.header.lodMetricType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodMetricValue",{get:function(){return this.header.lodMetricValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasEmptyContent",{get:function(){return!this.header.contentUrl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.selectedFrameNumber===this.tileset.frameNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasRenderContent",{get:function(){return!this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasChildren",{get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentReady",{get:function(){return"READY"===this.contentState||this.hasEmptyContent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentAvailable",{get:function(){return Boolean(this.contentReady&&this.hasRenderContent||!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasUnloadedContent",{get:function(){return this.hasRenderContent&&this.contentUnloaded},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentUnloaded",{get:function(){return"UNLOADED"===this.contentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contentFailed",{get:function(){return"FAILED"===this.contentState},enumerable:!1,configurable:!0}),t.prototype.getScreenSpaceError=function(e,t){if("TILES3D"===this.tileset.type)return function(e,t,n){var i=e.tileset,r=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,o=n?r:e.lodMetricValue;if(0===o)return 0;var a=Math.max(e.distanceToCamera,1e-7),s=i.options.viewDistanceScale,l=o*t.height*s/(a*t.sseDenominator);return l-Ei(i,a)}(this,e,t);throw new Error("Unsupported tileset type")},t.prototype.getPriority=function(){var e=this.tileset.traverser,t=e.options.skipLevelOfDetail,n="ADD"===this.refine||t;if(n&&!this.visible)return-1;if(this.tileset.frameNumber-this.touchedFrameNumber>=1)return-1;if("UNLOADED"===this.contentState)return-1;var i=this.parent,r=i&&(!n||0===this.screenSpaceError)?i.screenSpaceError:this.screenSpaceError,o=e.root?e.root.screenSpaceError:0;return Math.max(o-r,0)},t.prototype.loadContent=function(){var e=this;return this.hasEmptyContent||!this.contentUrl?Promise.resolve(!1):this.content?Promise.resolve(!0):(this.contentState="LOADING",this.tileset.requestScheduler.scheduleRequest(this.id,(function(){return e.getPriority()})).then((function(t){return t?Be(e.contentUrl,{responseType:"arraybuffer",allowHosts:e.tileset.options.allowHosts,networkSubscribe:e.tileset.options.networkSubscribe,requestProxy:e.tileset.options.requestProxy}).then((function(e){return e.body})).then((function(t){return new Promise((function(n,i){var r=function(t){var i=t.data,o=i.id,a=i.tile;o===e.id&&(n(a),Si.shared.worker.removeEventListener("message",r))};Si.shared.worker.addEventListener("message",r);var o={id:e.id,buffer:t};Si.shared.worker.postMessage(o,[t])}))})).then((function(n){return e.content=n,e.tileset.options.contentLoader(e).then((function(){return e.contentState="READY",t.done(),!0}))})).catch((function(n){return e.contentState="FAILED",t.done(),Promise.reject(n)})):(e.contentState="UNLOADED",Promise.resolve(!1))})))},t.prototype.unloadContent=function(){this.content=void 0,this.contentState="UNLOADED"},t.prototype.updateVisibility=function(e){if(this.frameNumber!==e.frameNumber){var t=this.parent,n=t?t.visibilityPlaneMask:Jn.MASK_INDETERMINATE,i=t?t.computedTransform:this.tileset.modelMatrix;this.updateTransform(i),this.distanceToCamera=this.distanceToTile(e),this.screenSpaceError=this.getScreenSpaceError(e,!1),this.visibilityPlaneMask=this.visibility(e,n),this.visible=this.visibilityPlaneMask!==Jn.MASK_OUTSIDE,this.frameNumber=e.frameNumber}},t.prototype.visibility=function(e,t){return e.cullingVolume.computeVisibilityWithPlaneMask(this.boundingVolume,t)},t.prototype.distanceToTile=function(e){return Math.sqrt(Math.max(this.boundingVolume.distanceSquaredTo(e.camera.position),0))},t.prototype.updateTransform=function(t){void 0===t&&(t=new e.Matrix4);var n=t.clone().multiply(this.transform);!n.equals(this.computedTransform)&&(this.computedTransform.copy(n),this.boundingVolume=Ci(this.header.boundingVolume,this.computedTransform))},t}(),Ti=function(){function e(){this.map=new Map,this.array=[],this._length=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!1,configurable:!0}),e.prototype.get=function(e){return this.array[e]},e.prototype.set=function(e,t){e>=this.length&&(this._length=e+1),this.map.has(this.array[e])&&this.map.delete(this.array[e]),this.array[e]=t,this.map.set(t,e)},e.prototype.delete=function(e){var t=this.map.get(e);void 0!==t&&t>=0&&(this.array.splice(t,1),this.map.delete(e),this._length--)},e.prototype.push=function(e){if(!this.map.has(e)){var t=this._length++;this.array[t]=e,this.map.set(e,t)}},e.prototype.pop=function(){var e=this.array[--this._length];return this.map.delete(e),e},e.prototype.reset=function(){this.array=[],this.map=new Map,this._length=0},e.prototype.find=function(e){return this.map.has(e)},e}(),Pi=function(){function e(e){var t;this.options=e,this._traversalStack=new Ti,this._emptyTraversalStack=new Ti,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={},this.maxDepth=null!==(t=e.maxDepth)&&void 0!==t?t:100}return e.prototype.traverse=function(e,t){this.root=e,this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)},e.prototype.reset=function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()},e.prototype.executeTraversal=function(e,t){var n=this._traversalStack;for(e.selectionDepth=1,n.push(e);n.length>0;){var i=n.pop(),r=!1;if(this.canTraverse(i,t)){this.updateChildTiles(i,t);var o=i.hasRenderContent?i.selectionDepth+1:i.selectionDepth;r=this.updateAndPushChildren(i,t,n,o)}var a=i.parent,s=Boolean(!a||a.shouldRefine),l=!r;i.hasRenderContent?"ADD"===i.refine?(this.loadTile(i,t.frameNumber),this.selectTile(i,t)):"REPLACE"===i.refine&&(this.loadTile(i,t.frameNumber),l&&this.selectTile(i,t)):(this.emptyTiles[i.id]=i,this.loadTile(i,t.frameNumber),l&&this.selectTile(i,t)),this.touchTile(i,t),i.shouldRefine=r&&s}this.options.onTraversalEnd(t)},e.prototype.updateChildTiles=function(e,t){for(var n=0,i=e.children;n<i.length;n++){var r=i[n];this.updateTile(r,t)}return!0},e.prototype.updateAndPushChildren=function(e,t,n,i){var r=this.options,o=r.loadSiblings,a=r.skipLevelOfDetail,s=e.children;s.sort(this.compareDistanceToCamera.bind(this));for(var l="REPLACE"===e.refine&&e.hasRenderContent&&!a,c=!1,u=!0,h=0,d=s;h<d.length;h++){var p=d[h];if(p.selectionDepth=i,p.visible?(n.find(p)&&n.delete(p),n.push(p),c=!0):(l||o)&&(this.loadTile(p,t.frameNumber),this.touchTile(p,t)),l){var f=void 0;if(f=p.hasRenderContent?p.contentAvailable:this.executeEmptyTraversal(p,t),!(u=u&&f))return!1}}return c||(u=!1),u},e.prototype.updateTile=function(e,t){this.updateTileVisibility(e,t)},e.prototype.selectTile=function(e,t){this.shouldSelectTile(e)&&(e.selectedFrameNumber=t.frameNumber,this.selectedTiles[e.id]=e)},e.prototype.loadTile=function(e,t){this.shouldLoadTile(e)&&(e.requestedFrameNumber=t,this.requestedTiles[e.id]=e)},e.prototype.touchTile=function(e,t){e.tileset.cache.touch(e),e.touchedFrameNumber=t.frameNumber},e.prototype.canTraverse=function(e,t,n,i){return void 0===n&&(n=!1),void 0===i&&(i=!1),!!e.hasChildren&&(!(!i&&!e.visible)&&this.shouldRefine(e,t,n))},e.prototype.shouldLoadTile=function(e){return e.hasUnloadedContent},e.prototype.shouldSelectTile=function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail},e.prototype.shouldRefine=function(e,t,n){if(e.hasEmptyContent)return!0;var i=e.screenSpaceError;return n&&(i=e.getScreenSpaceError(t,!0)),i>this.options.maxScreenSpaceError},e.prototype.updateTileVisibility=function(e,t){e.updateVisibility(t),1===e.depth&&(e.visible=!0)},e.prototype.meetsScreenSpaceErrorEarly=function(e,t){var n=e.parent;return!(!n||"ADD"!==n.refine)&&!this.shouldRefine(e,t,!0)},e.prototype.compareDistanceToCamera=function(e,t){return 0===t.distanceToCamera&&0===e.distanceToCamera?t.centerZDepth-e.centerZDepth:t.distanceToCamera-e.distanceToCamera},e.prototype.anyChildrenVisible=function(e,t){for(var n=!1,i=0,r=e.children;i<r.length;i++){var o=r[i];o.updateVisibility(t),n=n||o.visible}return n},e.prototype.executeEmptyTraversal=function(e,t){var n=!0,i=this._emptyTraversalStack;for(i.push(e);i.length>0&&n;){var r=i.pop();if(this.updateTile(r,t),r.visible||this.loadTile(r,t.frameNumber),this.touchTile(r,t),!r.hasRenderContent&&this.canTraverse(r,t,!1,!0))for(var o=0,a=r.children;o<a.length;o++){var s=a[o];i.find(s)&&i.delete(s),i.push(s)}else r.contentAvailable||(n=!1)}return n},e}();function Ri(e){for(var t=[],n=0,i=Object.keys(e);n<i.length;n++){var r=i[n];t.push(e[r])}return t}var Li=function(){function t(e,t){var n=this;this.rawJson=e,this.b3dmMapping=e.b3dmMapping,this.options=t,this.traverser=new Pi({loadSiblings:!1,maxScreenSpaceError:this.options.maxScreenSpaceError,skipLevelOfDetail:!1,maxDepth:this.options.maxDepth,onTraversalEnd:function(e){return n.onTraversalEnd(e)}}),this.cache=new Gn,this.requestScheduler=new _n({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.frameNumber=0,this.pendingCount=0,this._tiles={},this.selectedTiles=[],this.requestedTiles=[],this.memoryUsageInBytes=0,this.root=new Bi(this,e.root);for(var i=[this.root],r=1;r;)for(var o=i[--r],a=o.header.children,s=a.length,l=0;l<s;l++){var c=a[l],u=new Bi(this,c,o);o.children[l]=u,u.header.children&&u.header.children.length&&(i[r++]=u)}}return Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){return this.options.maxMemoryUsage},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"asset",{get:function(){return this.rawJson.asset},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.rawJson.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"basePath",{get:function(){return this.rawJson.basePath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelMatrix",{get:function(){return this.options.modelMatrix},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"geometricError",{get:function(){return this.rawJson.geometricError},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodMetricType",{get:function(){return this.rawJson.lodMetricType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lodMetricValue",{get:function(){return this.rawJson.lodMetricValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refine",{get:function(){return this.rawJson.root.refine},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tiles",{get:function(){return Ri(this._tiles)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"floorInfo",{get:function(){return this.rawJson.floorInfo||this.rawJson.floor_info||[]},enumerable:!1,configurable:!0}),t.prototype.reset=function(){for(var e=this,t=[this.root];t.length>0;){for(var n=t.pop(),i=0,r=n.children;i<r.length;i++){var o=r[i];t.push(o)}this.cache.unloadTile(n,(function(t){return e.unloadTile(t)}))}this.cache.reset(),this.traverser.reset(),this.selectedTiles=[],this.requestedTiles=[],this._tiles={}},t.prototype.isLoaded=function(){return 0===this.pendingCount&&0!==this.frameNumber},t.prototype.onTraversalEnd=function(t){var n=this,i=(new e.Vector3).fromArray(t.camera.position);this.selectedTiles=this.options.onTraversalComplete(Ri(this.traverser.selectedTiles)),this.requestedTiles=Ri(this.traverser.requestedTiles).slice().sort((function(e,t){return e.boundingVolume.center.distanceTo(i)-t.boundingVolume.center.distanceTo(i)}));for(var r=0,o=this.selectedTiles;r<o.length;r++){var a=o[r];this._tiles[a.id]=a}for(var s=0,l=this.requestedTiles;s<l.length;s++){(a=l[s]).contentUnloaded&&this.loadTile(a)}this.cache.unloadTiles((function(){return n.memoryUsageInBytes>1024*n.maxMemoryUsage*1024}),(function(e){n.unloadTile(e)}))},t.prototype.loadTile=function(e){var t=this;e.depth>this.options.maxDepth||(this.pendingCount++,e.loadContent().catch((function(n){var i=n.message||n.toString();return console.error("A 3D tile failed to load: ".concat(e.id," ").concat(i)),t.options.onTileError(e,i),!1})).then((function(n){t.pendingCount--,n&&(t.cache.add(e,(function(){e.content&&(t.memoryUsageInBytes+=e.content.byteLength||0)})),t.options.onTileLoad(e))})))},t.prototype.unloadTile=function(e){this.memoryUsageInBytes-=e.content&&e.content.byteLength||0,this.options.onTileUnload(e),e.unloadContent()},t}();function Oi(){return(65536*(1+Math.random())|0).toString(16).substring(1)}function Fi(){return(Oi()+Oi()+"-"+Oi()+"-4"+Oi().substr(0,3)+"-"+Oi()+"-"+Oi()+Oi()+Oi()).toLowerCase()}function ki(e,t){var n;return e.content&&(e.contentUrl="".concat(t,"/").concat(e.content.uri||e.content.url)),e.id=null!==(n=e.contentUrl)&&void 0!==n?n:"empty:"+Fi(),e.lodMetricType="geometricError",e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=e.contentUrl?"SCENEGRAPH":"EMPTY",e.refine=function(e){switch(e){case"REPLACE":case"replace":return"REPLACE";case"ADD":case"add":return"ADD";default:throw new Error("refine ".concat(e," is not supported."))}}(e.refine),e}function Di(e,t){var n,i=e;return i.basePath=t,i.root=function(e,t){e=ki(e,t);var n=[];for(n.push(e);n.length>0;)for(var i=0,r=(n.pop()||{}).children||[];i<r.length;i++){var o=r[i];ki(o,t),n.push(o)}return e}(i.root,t),i.type="TILES3D",i.lodMetricType="geometricError",i.lodMetricValue=(null===(n=i.root)||void 0===n?void 0:n.lodMetricValue)||0,i}var Qi=function(){function t(t){e.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null}function n(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:t,load:function(t,n,i,r){var o,a=this;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:e.LoaderUtils.extractUrlBase(t),a.manager.itemStart(t);var s=function(e){r?r(e):console.error(e),a.manager.itemError(t),a.manager.itemEnd(t)},l=new e.FileLoader(a.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),"use-credentials"===a.crossOrigin&&l.setWithCredentials(!0),l.load(t,(function(e){try{a.parse(e,o,(function(e){n(e),a.manager.itemEnd(t)}),s)}catch(e){s(e)}}),i,s)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},parse:function(t,n,c,u){var f,m={};if("string"==typeof t)f=t;else if(e.LoaderUtils.decodeText(new Uint8Array(t,0,4))===l){try{m[i.KHR_BINARY_GLTF]=new h(t)}catch(e){return void(u&&u(e))}f=m[i.KHR_BINARY_GLTF].content}else f=e.LoaderUtils.decodeText(new Uint8Array(t));var g=JSON.parse(f);if(void 0===g.asset||g.asset.version[0]<2)u&&u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{if(g.extensionsUsed)for(var y=0;y<g.extensionsUsed.length;++y){var b=g.extensionsUsed[y],x=g.extensionsRequired||[];switch(b){case i.KHR_LIGHTS_PUNCTUAL:m[b]=new o(g);break;case i.KHR_MATERIALS_CLEARCOAT:m[b]=new s;break;case i.KHR_MATERIALS_UNLIT:m[b]=new a;break;case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:m[b]=new A;break;case i.KHR_DRACO_MESH_COMPRESSION:m[b]=new d(g,this.dracoLoader);break;case i.MSFT_TEXTURE_DDS:m[b]=new r(this.ddsLoader);break;case i.KHR_TEXTURE_TRANSFORM:m[b]=new p;break;case i.KHR_MESH_QUANTIZATION:m[b]=new v;break;default:x.indexOf(b)>=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+b+'".')}}var w=new z(g,m,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager});w.fileLoader.setRequestHeader(this.requestHeader),w.parse(c,u)}}});var i={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=i.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=i.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[i.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function a(){this.name=i.KHR_MATERIALS_UNLIT}function s(){this.name=i.KHR_MATERIALS_CLEARCOAT}o.prototype.loadLight=function(t){var n,i=this.lightDefs[t],r=new e.Color(16777215);void 0!==i.color&&r.fromArray(i.color);var o=void 0!==i.range?i.range:0;switch(i.type){case"directional":(n=new e.DirectionalLight(r)).target.position.set(0,0,-1),n.add(n.target);break;case"point":(n=new e.PointLight(r)).distance=o;break;case"spot":(n=new e.SpotLight(r)).distance=o,i.spot=i.spot||{},i.spot.innerConeAngle=void 0!==i.spot.innerConeAngle?i.spot.innerConeAngle:0,i.spot.outerConeAngle=void 0!==i.spot.outerConeAngle?i.spot.outerConeAngle:Math.PI/4,n.angle=i.spot.outerConeAngle,n.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,n.target.position.set(0,0,-1),n.add(n.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+i.type+'".')}return n.position.set(0,0,0),n.decay=2,void 0!==i.intensity&&(n.intensity=i.intensity),n.name=i.name||"light_"+t,Promise.resolve(n)},a.prototype.getMaterialType=function(){return e.MeshBasicMaterial},a.prototype.extendParams=function(t,n,i){var r=[];t.color=new e.Color(1,1,1),t.opacity=1;var o=n.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var a=o.baseColorFactor;t.color.fromArray(a),t.opacity=a[3]}void 0!==o.baseColorTexture&&r.push(i.assignTexture(t,"map",o.baseColorTexture))}return Promise.all(r)},s.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},s.prototype.extendParams=function(t,n,i){var r=[],o=n.extensions[this.name];if(void 0!==o.clearcoatFactor&&(t.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&r.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&r.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(r.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var a=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new e.Vector2(a,a)}return Promise.all(r)};var l="glTF",c=12,u={JSON:1313821514,BIN:5130562};function h(t){this.name=i.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,c);if(this.header={magic:e.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==l)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=new DataView(t,c),o=0;o<r.byteLength;){var a=r.getUint32(o,!0);o+=4;var s=r.getUint32(o,!0);if(o+=4,s===u.JSON){var h=new Uint8Array(t,c+o,a);this.content=e.LoaderUtils.decodeText(h)}else if(s===u.BIN){var d=c+o;this.body=t.slice(d,d+a)}o+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function d(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=i.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function p(){this.name=i.KHR_TEXTURE_TRANSFORM}function f(t){e.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var n=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),i=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),o=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),s={specular:{value:(new e.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=s,this.onBeforeCompile=function(e){for(var t in s)e.uniforms[t]=s[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",i),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",o),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function A(){return{name:i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return f},extendParams:function(t,n,i){var r=n.extensions[this.name];t.color=new e.Color(1,1,1),t.opacity=1;var o=[];if(Array.isArray(r.diffuseFactor)){var a=r.diffuseFactor;t.color.fromArray(a),t.opacity=a[3]}if(void 0!==r.diffuseTexture&&o.push(i.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new e.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new e.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var s=r.specularGlossinessTexture;o.push(i.assignTexture(t,"glossinessMap",s)),o.push(i.assignTexture(t,"specularMap",s))}return Promise.all(o)},createMaterial:function(t){var n=new f(t);return n.fog=!0,n.color=t.color,n.map=void 0===t.map?null:t.map,n.lightMap=null,n.lightMapIntensity=1,n.aoMap=void 0===t.aoMap?null:t.aoMap,n.aoMapIntensity=1,n.emissive=t.emissive,n.emissiveIntensity=1,n.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,n.bumpMap=void 0===t.bumpMap?null:t.bumpMap,n.bumpScale=1,n.normalMap=void 0===t.normalMap?null:t.normalMap,n.normalMapType=e.TangentSpaceNormalMap,t.normalScale&&(n.normalScale=t.normalScale),n.displacementMap=null,n.displacementScale=1,n.displacementBias=0,n.specularMap=void 0===t.specularMap?null:t.specularMap,n.specular=t.specular,n.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,n.glossiness=t.glossiness,n.alphaMap=null,n.envMap=void 0===t.envMap?null:t.envMap,n.envMapIntensity=1,n.refractionRatio=.98,n}}}function v(){this.name=i.KHR_MESH_QUANTIZATION}function m(t,n,i,r){e.Interpolant.call(this,t,n,i,r)}d.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(var c in o){var u=T[c]||c.toLowerCase();a[u]=o[c]}for(c in e.attributes){u=T[c]||c.toLowerCase();if(void 0!==o[c]){var h=n.accessors[e.attributes[c]],d=E[h.componentType];l[u]=d,s[u]=!0===h.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t){i.decodeDracoFile(e,(function(e){for(var n in e.attributes){var i=e.attributes[n],r=s[n];void 0!==r&&(i.normalized=r)}t(e)}),a,l)}))}))},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},f.prototype=Object.create(e.MeshStandardMaterial.prototype),f.prototype.constructor=f,f.prototype.copy=function(t){return e.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},m.prototype=Object.create(e.Interpolant.prototype),m.prototype.constructor=m,m.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,o=0;o!==i;o++)t[o]=n[r+o];return t},m.prototype.beforeStart_=m.prototype.copySampleValue_,m.prototype.afterEnd_=m.prototype.copySampleValue_,m.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,c=i-t,u=(n-t)/c,h=u*u,d=h*u,p=e*l,f=p-l,A=-2*d+3*h,v=d-h,m=1-A,g=v-h+u,y=0;y!==a;y++){var b=o[f+y+a],x=o[f+y+s]*c,w=o[p+y+a],M=o[p+y]*c;r[y]=m*b+g*x+A*w+v*M}return r};var g=0,y=1,b=2,x=3,w=4,M=5,C=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},I={9728:e.NearestFilter,9729:e.LinearFilter,9984:e.NearestMipmapNearestFilter,9985:e.LinearMipmapNearestFilter,9986:e.NearestMipmapLinearFilter,9987:e.LinearMipmapLinearFilter},S={33071:e.ClampToEdgeWrapping,33648:e.MirroredRepeatWrapping,10497:e.RepeatWrapping},B={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},T={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},R={CUBICSPLINE:void 0,LINEAR:e.InterpolateLinear,STEP:e.InterpolateDiscrete},L="OPAQUE",O="MASK",F="BLEND",k={"image/png":e.RGBAFormat,"image/jpeg":e.RGBFormat};function D(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function Q(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function N(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function V(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n<i;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(n=0,i=r.length;n<i;n++)e.morphTargetDictionary[r[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function U(e){for(var t="",n=Object.keys(e).sort(),i=0,r=n.length;i<r;i++)t+=n[i]+":"+e[n[i]]+";";return t}function z(t,i,r){this.json=t||{},this.extensions=i||{},this.options=r||{},this.cache=new n,this.associations=new Map,this.primitiveCache={},this.textureLoader=new e.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new e.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function q(t,n,i){var r=n.attributes,o=[];function a(e,n){return i.getDependency("accessor",e).then((function(e){t.setAttribute(n,e)}))}for(var s in r){var l=T[s]||s.toLowerCase();l in t.attributes||o.push(a(r[s],l))}if(void 0!==n.indices&&!t.index){var c=i.getDependency("accessor",n.indices).then((function(e){t.setIndex(e)}));o.push(c)}return N(t,n),function(t,n,i){var r=n.attributes,o=new e.Box3;if(void 0!==r.POSITION){var a=(p=i.json.accessors[r.POSITION]).min,s=p.max;if(void 0!==a&&void 0!==s){o.set(new e.Vector3(a[0],a[1],a[2]),new e.Vector3(s[0],s[1],s[2]));var l=n.targets;if(void 0!==l){for(var c=new e.Vector3,u=new e.Vector3,h=0,d=l.length;h<d;h++){var p,f=l[h];if(void 0!==f.POSITION)a=(p=i.json.accessors[f.POSITION]).min,s=p.max,void 0!==a&&void 0!==s?(u.setX(Math.max(Math.abs(a[0]),Math.abs(s[0]))),u.setY(Math.max(Math.abs(a[1]),Math.abs(s[1]))),u.setZ(Math.max(Math.abs(a[2]),Math.abs(s[2]))),c.max(u)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}o.expandByVector(c)}t.boundingBox=o;var A=new e.Sphere;o.getCenter(A.center),A.radius=o.min.distanceTo(o.max)/2,t.boundingSphere=A}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,n,i),Promise.all(o).then((function(){return void 0!==n.targets?function(e,t,n){for(var i=!1,r=!1,o=0,a=t.length;o<a&&(void 0!==(c=t[o]).POSITION&&(i=!0),void 0!==c.NORMAL&&(r=!0),!i||!r);o++);if(!i&&!r)return Promise.resolve(e);var s=[],l=[];for(o=0,a=t.length;o<a;o++){var c=t[o];if(i){var u=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position;s.push(u)}r&&(u=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal,l.push(u))}return Promise.all([Promise.all(s),Promise.all(l)]).then((function(t){var n=t[0],o=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=o),e.morphTargetsRelative=!0,e}))}(t,n.targets,i):t}))}function H(t,n){var i=t.getIndex();if(null===i){var r=[],o=t.getAttribute("position");if(void 0===o)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var a=0;a<o.count;a++)r.push(a);t.setIndex(r),i=t.getIndex()}var s=i.count-2,l=[];if(n===e.TriangleFanDrawMode)for(a=1;a<=s;a++)l.push(i.getX(0)),l.push(i.getX(a)),l.push(i.getX(a+1));else for(a=0;a<s;a++)a%2==0?(l.push(i.getX(a)),l.push(i.getX(a+1)),l.push(i.getX(a+2))):(l.push(i.getX(a+2)),l.push(i.getX(a+1)),l.push(i.getX(a)));l.length/3!==s&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var c=t.clone();return c.setIndex(l),c}return z.prototype.parse=function(e,t){var n=this,i=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(t){var o={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};Q(r,o,i),N(o,i),e(o)})).catch(t)},z.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],i={},r={},o=0,a=t.length;o<a;o++)for(var s=t[o].joints,l=0,c=s.length;l<c;l++)e[s[l]].isBone=!0;for(var u=0,h=e.length;u<h;u++){var d=e[u];void 0!==d.mesh&&(void 0===i[d.mesh]&&(i[d.mesh]=r[d.mesh]=0),i[d.mesh]++,void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=i,this.json.meshUses=r},z.prototype.getDependency=function(e,t){var n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this.loadMesh(t);break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this.loadBufferView(t);break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this.loadMaterial(t);break;case"texture":r=this.loadTexture(t);break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;case"light":r=this.extensions[i.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r},z.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var n=this,i=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(i.map((function(t,i){return n.getDependency(e,i)}))),this.cache.add(e,t)}return t},z.prototype.loadBuffer=function(e){var t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[i.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(e,i){n.load(D(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},z.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var n=t.byteLength||0,i=t.byteOffset||0;return e.slice(i,i+n)}))},z.prototype.loadAccessor=function(t){var n=this,i=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);var o=[];return void 0!==r.bufferView?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),void 0!==r.sparse&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then((function(t){var o,a,s=t[0],l=B[r.type],c=E[r.componentType],u=c.BYTES_PER_ELEMENT,h=u*l,d=r.byteOffset||0,p=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,f=!0===r.normalized;if(p&&p!==h){var A=Math.floor(d/p),v="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+A+":"+r.count,m=n.cache.get(v);m||(o=new c(s,A*p,r.count*p/u),m=new e.InterleavedBuffer(o,p/u),n.cache.add(v,m)),a=new e.InterleavedBufferAttribute(m,l,d%p/u,f)}else o=null===s?new c(r.count*l):new c(s,d,r.count*l),a=new e.BufferAttribute(o,l,f);if(void 0!==r.sparse){var g=B.SCALAR,y=E[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,x=r.sparse.values.byteOffset||0,w=new y(t[1],b,r.sparse.count*g),M=new c(t[2],x,r.sparse.count*l);null!==s&&(a=new e.BufferAttribute(a.array.slice(),a.itemSize,a.normalized));for(var C=0,I=w.length;C<I;C++){var S=w[C];if(a.setX(S,M[C*l]),l>=2&&a.setY(S,M[C*l+1]),l>=3&&a.setZ(S,M[C*l+2]),l>=4&&a.setW(S,M[C*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))},z.prototype.loadTexture=function(t){var n,r=this,o=this.json,a=this.options,s=this.textureLoader,l=self.URL||self.webkitURL,c=o.textures[t],u=c.extensions||{},h=(n=u[i.MSFT_TEXTURE_DDS]?o.images[u[i.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,d=!1;return void 0!==n.bufferView&&(h=r.getDependency("bufferView",n.bufferView).then((function(e){d=!0;var t=new Blob([e],{type:n.mimeType});return h=l.createObjectURL(t)}))),Promise.resolve(h).then((function(e){var t=a.manager.getHandler(e);return t||(t=u[i.MSFT_TEXTURE_DDS]?r.extensions[i.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(n,i){t.load(D(e,a.path),n,void 0,i)}))})).then((function(i){!0===d&&l.revokeObjectURL(h),i.flipY=!1,c.name&&(i.name=c.name),n.mimeType in k&&(i.format=k[n.mimeType]);var a=(o.samplers||{})[c.sampler]||{};return i.magFilter=I[a.magFilter]||e.LinearFilter,i.minFilter=I[a.minFilter]||e.LinearMipmapLinearFilter,i.wrapS=S[a.wrapS]||e.RepeatWrapping,i.wrapT=S[a.wrapT]||e.RepeatWrapping,r.associations.set(i,{type:"textures",index:t}),i}))},z.prototype.assignTexture=function(t,n,r){var o=this;return this.getDependency("texture",r.index).then((function(a){if(!a.isCompressedTexture)switch(n){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=e.RGBFormat}if(void 0===r.texCoord||0==r.texCoord||"aoMap"===n&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+n+" not yet supported."),o.extensions[i.KHR_TEXTURE_TRANSFORM]){var s=void 0!==r.extensions?r.extensions[i.KHR_TEXTURE_TRANSFORM]:void 0;if(s){var l=this.associations.get(a);a=o.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),this.associations.set(a,l)}}t[n]=a}))},z.prototype.assignFinalMaterial=function(t){var n=t.geometry,i=t.material,r=void 0!==n.attributes.tangent,o=void 0!==n.attributes.color,a=void 0===n.attributes.normal,s=!0===t.isSkinnedMesh,l=Object.keys(n.morphAttributes).length>0,c=l&&void 0!==n.morphAttributes.normal;if(t.isPoints){var u="PointsMaterial:"+i.uuid,h=this.cache.get(u);h||(h=new e.PointsMaterial,e.Material.prototype.copy.call(h,i),h.color.copy(i.color),h.map=i.map,h.sizeAttenuation=!1,this.cache.add(u,h)),i=h}else if(t.isLine){u="LineBasicMaterial:"+i.uuid;var d=this.cache.get(u);d||(d=new e.LineBasicMaterial,e.Material.prototype.copy.call(d,i),d.color.copy(i.color),this.cache.add(u,d)),i=d}if(r||o||a||s||l){u="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),s&&(u+="skinning:"),r&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),a&&(u+="flat-shading:"),l&&(u+="morph-targets:"),c&&(u+="morph-normals:");var p=this.cache.get(u);p||(p=i.clone(),s&&(p.skinning=!0),r&&(p.vertexTangents=!0),o&&(p.vertexColors=!0),a&&(p.flatShading=!0),l&&(p.morphTargets=!0),c&&(p.morphNormals=!0),this.cache.add(u,p),this.associations.set(p,this.associations.get(i))),i=p}i.aoMap&&void 0===n.attributes.uv2&&void 0!==n.attributes.uv&&n.setAttribute("uv2",n.attributes.uv),i.normalScale&&!r&&(i.normalScale.y=-i.normalScale.y),i.clearcoatNormalScale&&!r&&(i.clearcoatNormalScale.y=-i.clearcoatNormalScale.y),t.material=i},z.prototype.loadMaterial=function(t){var n,r=this,o=this.json,a=this.extensions,s=o.materials[t],l={},c=s.extensions||{},u=[];if(c[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=a[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];n=h.getMaterialType(),u.push(h.extendParams(l,s,r))}else if(c[i.KHR_MATERIALS_UNLIT]){var d=a[i.KHR_MATERIALS_UNLIT];n=d.getMaterialType(),u.push(d.extendParams(l,s,r))}else{n=e.MeshStandardMaterial;var p=s.pbrMetallicRoughness||{};if(l.color=new e.Color(1,1,1),l.opacity=1,Array.isArray(p.baseColorFactor)){var A=p.baseColorFactor;l.color.fromArray(A),l.opacity=A[3]}void 0!==p.baseColorTexture&&u.push(r.assignTexture(l,"map",p.baseColorTexture)),l.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,l.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(u.push(r.assignTexture(l,"metalnessMap",p.metallicRoughnessTexture)),u.push(r.assignTexture(l,"roughnessMap",p.metallicRoughnessTexture)))}!0===s.doubleSided&&(l.side=e.DoubleSide);var v=s.alphaMode||L;if(v===F?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,v===O&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&n!==e.MeshBasicMaterial&&(u.push(r.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new e.Vector2(1,1),void 0!==s.normalTexture.scale&&l.normalScale.set(s.normalTexture.scale,s.normalTexture.scale)),void 0!==s.occlusionTexture&&n!==e.MeshBasicMaterial&&(u.push(r.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&n!==e.MeshBasicMaterial&&(l.emissive=(new e.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&n!==e.MeshBasicMaterial&&u.push(r.assignTexture(l,"emissiveMap",s.emissiveTexture)),c[i.KHR_MATERIALS_CLEARCOAT]){var m=a[i.KHR_MATERIALS_CLEARCOAT];n=m.getMaterialType(),u.push(m.extendParams(l,{extensions:c},r))}return Promise.all(u).then((function(){var o;return o=n===f?a[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new n(l),s.name&&(o.name=s.name),o.map&&(o.map.encoding=e.sRGBEncoding),o.emissiveMap&&(o.emissiveMap.encoding=e.sRGBEncoding),N(o,s),r.associations.set(o,{type:"materials",index:t}),s.extensions&&Q(a,o,s),o}))},z.prototype.loadGeometries=function(t){var n=this,r=this.extensions,o=this.primitiveCache;function a(e){return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,n).then((function(t){return q(t,e,n)}))}for(var s,l,c=[],u=0,h=t.length;u<h;u++){var d,p=t[u],f=(l=void 0,(l=(s=p).extensions&&s.extensions[i.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+U(l.attributes):s.indices+":"+U(s.attributes)+":"+s.mode),A=o[f];if(A)c.push(A.promise);else d=p.extensions&&p.extensions[i.KHR_DRACO_MESH_COMPRESSION]?a(p):q(new e.BufferGeometry,p,n),o[f]={primitive:p,promise:d},c.push(d)}return Promise.all(c)},z.prototype.loadMesh=function(t){for(var n,i=this,r=this.json.meshes[t],o=r.primitives,a=[],s=0,l=o.length;s<l;s++){var c=void 0===o[s].material?(void 0===(n=this.cache).DefaultMaterial&&(n.DefaultMaterial=new e.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:e.FrontSide})),n.DefaultMaterial):this.getDependency("material",o[s].material);a.push(c)}return a.push(i.loadGeometries(o)),Promise.all(a).then((function(n){for(var a=n.slice(0,n.length-1),s=n[n.length-1],l=[],c=0,u=s.length;c<u;c++){var h,d=s[c],p=o[c],f=a[c];if(p.mode===w||p.mode===M||p.mode===C||void 0===p.mode)!0!==(h=!0===r.isSkinnedMesh?new e.SkinnedMesh(d,f):new e.Mesh(d,f)).isSkinnedMesh||h.geometry.attributes.skinWeight.normalized||h.normalizeSkinWeights(),p.mode===M?h.geometry=H(h.geometry,e.TriangleStripDrawMode):p.mode===C&&(h.geometry=H(h.geometry,e.TriangleFanDrawMode));else if(p.mode===y)h=new e.LineSegments(d,f);else if(p.mode===x)h=new e.Line(d,f);else if(p.mode===b)h=new e.LineLoop(d,f);else{if(p.mode!==g)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);h=new e.Points(d,f)}Object.keys(h.geometry.morphAttributes).length>0&&V(h,r),h.name=r.name||"mesh_"+t,s.length>1&&(h.name+="_"+c),N(h,r),i.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var A=new e.Group;for(c=0,u=l.length;c<u;c++)A.add(l[c]);return A}))},z.prototype.loadCamera=function(t){var n,i=this.json.cameras[t],r=i[i.type];if(r)return"perspective"===i.type?n=new e.PerspectiveCamera(e.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(n=new e.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(n.name=i.name),N(n,i),Promise.resolve(n);console.warn("THREE.GLTFLoader: Missing camera parameters.")},z.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))},z.prototype.loadAnimation=function(t){for(var n=this.json.animations[t],i=[],r=[],o=[],a=[],s=[],l=0,c=n.channels.length;l<c;l++){var u=n.channels[l],h=n.samplers[u.sampler],d=u.target,p=void 0!==d.node?d.node:d.id,f=void 0!==n.parameters?n.parameters[h.input]:h.input,A=void 0!==n.parameters?n.parameters[h.output]:h.output;i.push(this.getDependency("node",p)),r.push(this.getDependency("accessor",f)),o.push(this.getDependency("accessor",A)),a.push(h),s.push(d)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(o),Promise.all(a),Promise.all(s)]).then((function(i){for(var r=i[0],o=i[1],a=i[2],s=i[3],l=i[4],c=[],u=0,h=r.length;u<h;u++){var d=r[u],p=o[u],f=a[u],A=s[u],v=l[u];if(void 0!==d){var g;switch(d.updateMatrix(),d.matrixAutoUpdate=!0,P[v.path]){case P.weights:g=e.NumberKeyframeTrack;break;case P.rotation:g=e.QuaternionKeyframeTrack;break;default:g=e.VectorKeyframeTrack}var y=d.name?d.name:d.uuid,b=void 0!==A.interpolation?R[A.interpolation]:e.InterpolateLinear,x=[];P[v.path]===P.weights?d.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&x.push(e.name?e.name:e.uuid)})):x.push(y);var w=f.array;if(f.normalized){var M;if(w.constructor===Int8Array)M=1/127;else if(w.constructor===Uint8Array)M=1/255;else if(w.constructor==Int16Array)M=1/32767;else{if(w.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");M=1/65535}for(var C=new Float32Array(w.length),E=0,I=w.length;E<I;E++)C[E]=w[E]*M;w=C}for(E=0,I=x.length;E<I;E++){var S=new g(x[E]+"."+P[v.path],p.array,w,b);"CUBICSPLINE"===A.interpolation&&(S.createInterpolant=function(e){return new m(this.times,this.values,this.getValueSize()/3,e)},S.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),c.push(S)}}}var B=n.name?n.name:"animation_"+t;return new e.AnimationClip(B,void 0,c)}))},z.prototype.loadNode=function(t){var n,r=this.json,o=this.extensions,a=this,s=r.meshReferences,l=r.meshUses,c=r.nodes[t];return(n=[],void 0!==c.mesh&&n.push(a.getDependency("mesh",c.mesh).then((function(e){var t;if(s[c.mesh]>1){var n=l[c.mesh]++;(t=e.clone()).name+="_instance_"+n}else t=e;return void 0!==c.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=c.weights.length;t<n;t++)e.morphTargetInfluences[t]=c.weights[t]})),t}))),void 0!==c.camera&&n.push(a.getDependency("camera",c.camera)),c.extensions&&c.extensions[i.KHR_LIGHTS_PUNCTUAL]&&void 0!==c.extensions[i.KHR_LIGHTS_PUNCTUAL].light&&n.push(a.getDependency("light",c.extensions[i.KHR_LIGHTS_PUNCTUAL].light)),Promise.all(n)).then((function(n){var i;if((i=!0===c.isBone?new e.Bone:n.length>1?new e.Group:1===n.length?n[0]:new e.Object3D)!==n[0])for(var r=0,s=n.length;r<s;r++)i.add(n[r]);if(c.name&&(i.userData.name=c.name,i.name=e.PropertyBinding.sanitizeNodeName(c.name)),N(i,c),c.extensions&&Q(o,i,c),void 0!==c.matrix){var l=new e.Matrix4;l.fromArray(c.matrix),i.applyMatrix4(l)}else void 0!==c.translation&&i.position.fromArray(c.translation),void 0!==c.rotation&&i.quaternion.fromArray(c.rotation),void 0!==c.scale&&i.scale.fromArray(c.scale);return a.associations.set(i,{type:"nodes",index:t}),i}))},z.prototype.loadScene=function(){function t(n,i,r,o){var a=r.nodes[n];return o.getDependency("node",n).then((function(t){return void 0===a.skin?t:o.getDependency("skin",a.skin).then((function(e){for(var t=[],i=0,r=(n=e).joints.length;i<r;i++)t.push(o.getDependency("node",n.joints[i]));return Promise.all(t)})).then((function(i){return t.traverse((function(t){if(t.isMesh){for(var r=[],o=[],a=0,s=i.length;a<s;a++){var l=i[a];if(l){r.push(l);var c=new e.Matrix4;void 0!==n.inverseBindMatrices&&c.fromArray(n.inverseBindMatrices.array,16*a),o.push(c)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',n.joints[a])}t.bind(new e.Skeleton(r,o),t.matrixWorld)}})),t}));var n})).then((function(e){i.add(e);var n=[];if(a.children)for(var s=a.children,l=0,c=s.length;l<c;l++){var u=s[l];n.push(t(u,e,r,o))}return Promise.all(n)}))}return function(n){var i=this.json,r=this.extensions,o=this.json.scenes[n],a=new e.Group;o.name&&(a.name=o.name),N(a,o),o.extensions&&Q(r,a,o);for(var s=o.nodes||[],l=[],c=0,u=s.length;c<u;c++)l.push(t(s[c],a,i,this));return Promise.all(l).then((function(){return a}))}}(),t}(),Ni=new Qi,Vi=(new i.Matrix4).makeRotationAxis(new i.Vector3(1,0,0),Math.PI/2);function Ui(e){function t(e){if(e.isMesh)return function(e){var t=new je;t.geometry=e.geometry,t.geometry.computeVertexNormals(),t.geometry.computeBoundingBox(),t.geometry.computeBoundingSphere(),t.geometry.addGroup(0,e.geometry.index.count,0);var n=new Bt;return n.uniforms.map.value=e.material.map,n.uniforms.map.value&&(n.uniforms.map.value.magFilter=i.LinearFilter,n.uniforms.map.value.minFilter=i.LinearFilter,n.uniforms.map.value.generateMipmaps=!1),n.uniforms.exposure.value=3.3,n.opacity=1,e.material.dispose(),e.geometry=null,e.material=null,t.material=[n],t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrix.compose(t.position,t.quaternion,t.scale),t}(e);if(e.isGroup){for(var n=function(e){var t=new Ge;return t.position.copy(e.position),t.quaternion.copy(e.quaternion),t.scale.copy(e.scale),t.matrix.compose(t.position,t.quaternion,t.scale),t}(e),r=0;r<e.children.length;r++){var o=t(e.children[r]);n.add(o)}return n}return new Ge}return new Promise((function(n,r){var o,a=(new i.Matrix4).copy(e.computedTransform);if("Z"!==(null===(o=e.tileset.asset)||void 0===o?void 0:o.gltfUpAxis)&&a.multiply(Vi),e.content){var s=e.content.gltfArrayBuffer;delete e.content.gltfArrayBuffer;var l=e.contentUrl?e.contentUrl.slice(0,e.contentUrl.lastIndexOf("/")+1):"";Ni.parse(s,l,(function(i){var r=i.scene,o=new Ge,s=t(r);s.applyMatrix4(a),o.add(s),e.contentUrl&&(o.name=e.contentUrl),n(o)}),(function(t){r(new Error("error parsing gltf in tile ".concat(e.id,": ").concat(t.message)))}))}else n(new Ge)}))}function zi(e){e.traverse((function(e){if(e instanceof je){e.geometry.dispose();for(var t=0,n=e.material;t<n.length;t++){var i=n[t];i.uniforms.map&&i.uniforms.map.value&&(i.uniforms.map.value.dispose(),i.uniforms.map.value=null),i.dispose()}}}))}function qi(e){e.updateMatrix(),e.updateMatrixWorld();var t=(new i.Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse);return(new i.Frustum).setFromProjectionMatrix(t)}new i.EdgesGeometry(new i.BoxBufferGeometry(1,1,1)),new i.LineBasicMaterial({color:new i.Color(1,1,0),transparent:!0});var Hi=["tileTextureUpload","basicTileLoaded"],_i={throttleRequests:!0,maxRequests:64,updateInterval:.1,maxScreenSpaceError:8,maxMemoryUsage:24,viewDistanceScale:.2,onNodeCreated:function(){},maxDepth:100},ji=function(e){function t(t,n,r){var o,a=this;return(a=e.call(this)||this).options=re(re({},_i),t),a.options.maxDepth=null!==(o=a.options.maxDepth)&&void 0!==o?o:100,a.clock=new i.Clock,a.timer=0,a.unloadTileQueue=[],a.nodes={},a.boundings={},a.nodeGroup=new i.Group,a.boundingGroup=new i.Group,a.add(a.nodeGroup),a.sseDenominator=null,a.lastCameraTransform=new i.Matrix4,a.lastCameraAspect=1,a.lastCameraFov=null,a.lastCamera=null,a.lastRenderer=null,a.enabled=!1,a.listener=new ce,a.basicTiles=[],a.parseTask=[],a.originModel=n,a.renderer=r,a}return ie(t,e),Object.defineProperty(t.prototype,"enable",{get:function(){return this.enabled},set:function(e){this.enabled!==e&&(this.enabled=e,!1===this.enabled?this.reset():(this.timer=0,this.clock.getDelta()))},enumerable:!1,configurable:!0}),t.prototype.load=function(e){var t=this,n=e.tileset_url;e.tileset_url_md5;var r=e.b3md_mappings_url;e.b3md_mappings_url_md5;var o={modelMatrix:(new i.Matrix4).fromArray([1,0,0,0,0,-1,0,1e9,0,0,-1,0,0,0,0,1]),maxMemoryUsage:this.options.maxMemoryUsage,maxScreenSpaceError:this.options.maxScreenSpaceError,viewDistanceScale:this.options.viewDistanceScale,throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests,maxDepth:this.options.maxDepth,contentLoader:function(e){if("SCENEGRAPH"===e.type||"MESH"===e.type)return Ui(e).then((function(n){return new Promise((function(i,r){void 0===t.tileset?zi(n):(n.visible=!1,t.nodes[e.id]=n,t.nodeGroup.add(n),t.options.onNodeCreated(n),n.updateMatrixWorld(!0)),i()}))}))},onTileLoad:function(){t.enabled&&t.tileset&&t.lastRenderer&&t.lastCamera&&(t.tileset.frameNumber++,t.tilesetUpdate(t.tileset,t.lastRenderer,t.lastCamera)),t.enabled||t.reset()},onTileUnload:function(e){t.unloadTileQueue.push(e)},onTileError:function(e,t){console.error("Tile error",e.id,t)},onTraversalComplete:function(e){return e},allowHosts:this.options.allowHosts,networkSubscribe:this.options.networkSubscribe,requestProxy:this.options.requestProxy},a=n.split("/").slice(0,-1).join("/"),s=Be(n,{allowHosts:this.options.allowHosts,networkSubscribe:this.options.networkSubscribe,requestProxy:this.options.requestProxy}).then((function(e){return Di(JSON.parse(e.body),a)})),l=Be(r,{allowHosts:this.options.allowHosts,networkSubscribe:this.options.networkSubscribe,requestProxy:this.options.requestProxy}).then((function(e){return JSON.parse(e.body)}));Promise.all([s,l]).then((function(e){var n=e[0],r=e[1];n.b3dmMapping=r;var a=t.tileset=new Li(n,o),s=new i.Matrix4;if(a.root&&a.root.boundingVolume){var l=a.root.boundingVolume,c=l.halfAxes,u=l.center;s.extractRotation(function(e){var t=e.toArray();return(new i.Matrix4).fromArray([2*t[0],2*t[1],2*t[2],0,2*t[3],2*t[4],2*t[5],0,2*t[6],2*t[7],2*t[8],0,0,0,0,1])}(c)),s.setPosition(u.x,u.y,u.z)}a.modelMatrix.copy((new i.Matrix4).getInverse(s))}))},t.prototype.update=function(e,t){this.lastCamera=t,this.lastRenderer=e,!1!==this.enabled&&(this.timer+=this.clock.getDelta(),this.tileset&&this.timer>=this.options.updateInterval&&(t.matrixWorld.equals(this.lastCameraTransform)&&t.aspect===this.lastCameraAspect&&t.fov===this.lastCameraFov||(this.timer=0,this.tileset.frameNumber++,this.lastCameraTransform.copy(t.matrixWorld),this.tilesetUpdate(this.tileset,e,t))))},t.prototype.tilesetUpdate=function(e,t,n){var r,o;this.sseDenominator&&n.aspect===this.lastCameraAspect&&n.fov===this.lastCameraFov||(this.sseDenominator=function(e){var t=e.aspect,n=e.fov/180*Math.PI,i=e.aspect<=1?n:2*Math.atan(Math.tan(.5*n)/t);return 2*Math.tan(.5*i)}(n),this.lastCameraAspect=n.aspect,this.lastCameraFov=n.fov);var a,s,l,c={camera:{position:n.position.toArray(),direction:n.getDirection(new i.Vector3).toArray(),up:n.up.toArray()},height:t.getSize(new i.Vector2).height,frameNumber:e.frameNumber,sseDenominator:this.sseDenominator,cullingVolume:(a=qi(n),s=a.planes.map((function(e){return new i.Plane(e.normal,e.constant)})),new Jn(s))};if(e.cache.reset(),e.traverser.traverse(e.root,c),this.basicTiles=e.tiles.filter((function(e){return 1===e.depth})),this.basicTiles.length===(null===(r=this.tileset)||void 0===r?void 0:r.root.children.length))for(var u=0,h=e.tiles;u<h.length;u++){var d=h[u],p=d.selected,f=d.id;this.nodes[f]&&this.nodes[f].visible!==p&&(this.nodes[f].visible=p,p&&(this.needsRender=!0))}for(this.basicTiles.length===(null===(o=this.tileset)||void 0===o?void 0:o.root.children.length)&&(this.originModel.visible=!1,this.needsRender=!0);l=this.unloadTileQueue.pop();){f=l.id;if(this.nodes[f]){var A=this.nodes[f];this.nodeGroup.remove(A),zi(A),delete this.nodes[f]}}},t.prototype.reset=function(){if(this.tileset){this.tileset.reset();var e=void 0;for(this.basicTiles.length=0;e=this.unloadTileQueue.pop();)if("UNLOADED"!==e.contentState){var t=e.id;if(this.nodes[t]){var n=this.nodes[t];this.nodeGroup.remove(n),zi(n),delete this.nodes[t]}if(this.boundings[t]){n=this.boundings[t];this.boundingGroup.remove(n),delete this.boundings[t]}}for(var i=0,r=Object.keys(this.nodes);i<r.length;i++){t=r[i];var o=this.nodes[t];this.nodeGroup.remove(o),zi(o),delete this.nodes[t]}for(var a=0,s=Object.keys(this.boundings);a<s.length;a++){t=s[a],o=this.boundings[t];this.boundingGroup.remove(o),delete this.boundings[t]}}},t}(Ke);function Ki(e){return null==e}var Gi=function(e,t){void 0===t&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var n={},r=e.getIndex(),o=e.getAttribute("position"),a=r?r.count:o.count,s=0,l=Object.keys(e.attributes),c={},u={},h=[],d=["getX","getY","getZ","getW"],p=0,f=l.length;p<f;p++){c[b=l[p]]=[],(C=e.morphAttributes[b])&&(u[b]=new Array(C.length).fill().map((function(){return[]})))}var A=Math.log10(1/t),v=Math.pow(10,A);for(p=0;p<a;p++){var m=r?r.getX(p):p,g="",y=0;for(f=l.length;y<f;y++)for(var b=l[y],x=(M=e.getAttribute(b)).itemSize,w=0;w<x;w++)g+="".concat(~~(M[d[w]](m)*v),",");if(g in n)h.push(n[g]);else{for(y=0,f=l.length;y<f;y++){b=l[y];var M=e.getAttribute(b),C=e.morphAttributes[b],E=(x=M.itemSize,c[b]),I=u[b];for(w=0;w<x;w++){var S=d[w];if(E.push(M[S](m)),C)for(var B=0,T=C.length;B<T;B++)I[B].push(C[B][S](m))}}n[g]=s,h.push(s),s++}}var P=e.clone();for(p=0,f=l.length;p<f;p++){b=l[p];var R=e.getAttribute(b),L=new R.array.constructor(c[b]);M=new i.BufferAttribute(L,R.itemSize,R.normalized);if(P.setAttribute(b,M),b in u)for(y=0;y<u[b].length;y++){var O=e.morphAttributes[b][y],F=(L=new O.array.constructor(u[b][y]),new i.BufferAttribute(L,O.itemSize,O.normalized));P.morphAttributes[b][y]=F}}return P.setIndex(h),P};function Wi(e){var t;return new((t=i.Triangle).bind.apply(t,oe([void 0],e.map((function(e){return new i.Vector3(e.x,e.y,e.z)})),!1)))}var Xi={at3d:function(e,t){for(var n=Ln(t.textureOptions,e.textures.length),i={},r=0,o=e.textures;r<o.length;r++){var a=o[r];i[a]=Pn(a,n,t.allowHosts,t.requestProxy,t.networkSubscribe,t.renderer)}return Promise.resolve().then((function(){return Be(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return cn(e.body)})).then((function(e){return $t((function(){for(var t,n={chunks:[],createAt:void 0,description:void 0},i=0,r=e;i<r.length;i++){var o=r[i],a=En.decode(o);a.chunks.length&&((t=n.chunks).push.apply(t,a.chunks),n.createAt=a.createAt,n.description=a.description)}return n}))})).then((function(r){return $t((function(){return Rn(r,e.textureBase,e.textures.slice(),n,i,t.allowHosts,t.requestProxy,t.networkSubscribe,t.renderer)}))}))},pbm:function(e,t){for(var n=Ln(t.textureOptions,e.textures.length),i={},r=0,o=e.textures;r<o.length;r++){var a=o[r];i[a]=Pn(a,n,t.allowHosts,t.requestProxy,t.networkSubscribe)}return Promise.resolve().then((function(){return Be(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return $t((function(){var t=new Uint8Array(e.body);return En.decode(t)}))})).then((function(r){return $t((function(){return Rn(r,e.textureBase,e.textures.slice(),n,i,t.allowHosts,t.requestProxy,t.networkSubscribe,t.renderer)}))}))},dome:function(e,t){return Promise.resolve().then((function(){return Be(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(n){return qn(new Uint8Array(n.body),e.textureBase,t.textureOptions,t.allowHosts,t.requestProxy,t.networkSubscribe)}))},domez:function(e,t){return Promise.resolve().then((function(){return Be(e.file,{responseType:"arraybuffer",allowHosts:t.allowHosts,requestProxy:t.requestProxy,networkSubscribe:t.networkSubscribe})})).then((function(e){return cn(e.body)})).then((function(e){var t=e.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(t),i=0;return e.forEach((function(e){n.set(e,i),i+=e.length})),n})).then((function(n){return qn(n,e.textureBase,t.textureOptions,t.allowHosts,t.requestProxy,t.networkSubscribe)}))}},Yi=function(e){function t(t,n){var r=e.call(this)||this;return r.empty=!0,r.name="model",r.workCode="",r.loaded=!1,r.bvhs=Object.assign([],{loaded:!1}),r.bounding=new i.Box3,r.shownFloor=null,r.floorLength=0,r.textureOptions={},r.requestProxy=t.requestProxy,r.networkSubscribe=t.networkSubscribe,r.allowHosts=t.allowHosts,r.renderOrder=-4,r.renderer=n,r}return ie(t,e),Object.defineProperty(t.prototype,"shownfloor",{get:function(){return this.shownFloor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTiles",{get:function(){return void 0!==this.tiledModel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableTiles",{get:function(){return!!this.tiledModel&&this.tiledModel.enable},set:function(e){this.tiledModel&&(this.tiledModel.enable=e)},enumerable:!1,configurable:!0}),t.prototype.updateTexture=function(e){return this.textureOptions=e,Promise.resolve()},t.prototype.getEdges=function(e){var t;if(void 0===e&&(e=30/180*Math.PI),!this.originModel)return[];for(var n=Math.cos(e),r=[],o=0,a=this.originModel.children;o<a.length;o++){var s=a[o];if(s instanceof je){var l={},c=["a","b","c"],u=Gi(s.geometry),h=u.getAttribute("position").array,d=(null===(t=u.getIndex())||void 0===t?void 0:t.array)||[];u.dispose();for(var p=[],f=[],A=0,v=h.length;A<v;A+=3)p.push(new i.Vector3(h[A],h[A+1],h[A+2]));for(A=0,v=d.length;A<v;A+=3){var m=d[A],g=d[A+1],y=d[A+2],b=(new i.Vector3).crossVectors(p[g].clone().sub(p[m]),p[y].clone().sub(p[m])).normalize();f.push({a:m,b:g,c:y,normal:b})}for(A=0,v=f.length;A<v;A++)for(var x=f[A],w=0;w<3;w++){var M=x[c[w]],C=x[c[(w+1)%3]],E=[Math.min(M,C),Math.max(M,C)];void 0===l[I=E[0]+"-"+E[1]]?l[I]={index1:E[0],index2:E[1],face1:A}:l[I].face2=A}for(var I in l){var S=l[I];if(void 0===S.face2||f[S.face1].normal.dot(f[S.face2].normal)<=n){var B=p[S.index1],T=p[S.index2];r.push(new i.Line3(B,T))}}p.length=0,f.length=0}}return r},t.prototype.getEdgesBySphere=function(e,t){var n;if(void 0===t&&(t=30/180*Math.PI),!this.bvhs)return[];for(var r=Math.cos(t),o=[],a=0,s=this.bvhs;a<s.length;a++){var l={},c=["a","b","c"],u=s[a].trianglesInSphere(e.center,e.radius),h=new i.BufferGeometry;h.setAttribute("position",new i.BufferAttribute(u,3));var d=Gi(h),p=d.getAttribute("position").array,f=(null===(n=d.getIndex())||void 0===n?void 0:n.array)||[];h.dispose(),d.dispose();for(var A=[],v=[],m=0,g=p.length;m<g;m+=3)A.push(new i.Vector3(p[m],p[m+1],p[m+2]));for(m=0,g=f.length;m<g;m+=3){var y=f[m],b=f[m+1],x=f[m+2],w=(new i.Vector3).crossVectors(A[b].clone().sub(A[y]),A[x].clone().sub(A[y])).normalize();v.push({a:y,b:b,c:x,normal:w})}for(m=0,g=v.length;m<g;m++)for(var M=v[m],C=0;C<3;C++){var E=M[c[C]],I=M[c[(C+1)%3]],S=[Math.min(E,I),Math.max(E,I)];void 0===l[B=S[0]+"-"+S[1]]?l[B]={index1:S[0],index2:S[1],face1:m}:l[B].face2=m}for(var B in l){var T=l[B];if(void 0===T.face2||v[T.face1].normal.dot(v[T.face2].normal)<=r){var P=A[T.index1],R=A[T.index2];o.push(new i.Line3(P,R))}}A.length=0,v.length=0}return o},t.prototype.hasFloors=function(){return this.hasFloors_()},t.prototype.hasFloors_=function(){var e=[];return this.traverse((function(t){t instanceof je&&(e[t.floorIndex]=!0)})),e.length},t.prototype.show=function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=this.shownFloor,a=null,s=null!==(e=n[1])&&void 0!==e?e:.1,l=0!==n.length;this.shownFloor=a=l?n[0]:null,this.setMaterial({opacity:1,floorInfo:new i.Vector3(0,0,0)}),(null===(t=this.tiledModel)||void 0===t?void 0:t.enable)?this.b3dmShow(o,a):this.at3dShow(o,a,s)},t.prototype.at3dShow=function(e,t,n){var i;null===(i=this.originModel)||void 0===i||i.traverse((function(e){e instanceof je&&e.material.forEach((function(i){null===t||t===e.floorIndex?i.opacity=1*i.originOpacity:i.opacity=i.originOpacity*n}))})),e!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0},t.prototype.b3dmShow=function(e,t){var n,r;if(null===(r=null===(n=this.tiledModel)||void 0===n?void 0:n.tileset)||void 0===r?void 0:r.floorInfo){if("number"==typeof t&&t>=0&&t<this.tiledModel.tileset.floorInfo.length){var o=this.tiledModel.tileset.floorInfo,a=-o[t].ground,s=o[t].height+a;this.setMaterial({opacity:1,floorInfo:new i.Vector3(a,s,0)})}else this.setMaterial({opacity:1,floorInfo:new i.Vector3(0,0,0)});e!==this.shownFloor&&this.emit("shownFloorChange",this.shownFloor,this.floorLength),this.needsRender=!0}},t.prototype.intersectRaycaster=function(e,t){var n=e.ray,r=n.origin,o=n.direction;if(Ki(t))if(Ki(this.shownFloor)){var a=this.floorLength;t=[];for(var s=-1;s<a;s++)t.push(s)}else t=[this.shownFloor];var l=[],c=[];Array.isArray(t)?c.push.apply(c,t):c.push(t);for(var u=function(t){var n=h.bvhs&&h.bvhs[t];if(n){var a=new Ut(r.x,r.y,r.z),s=new Ut(o.x,o.y,o.z),c=n.intersectRay(a,s,!0).map((function(e){var t=e.intersectionPoint,n=e.triangle,o=new i.Vector3(t.x,t.y,t.z);return{point:o,face:{normal:Wi(n).getNormal(new i.Vector3)},distance:r.distanceTo(o)}}));c.length&&l.push.apply(l,c)}else if(h.originModel){var u=[];h.originModel.traverse((function(e){e instanceof je&&e.floorIndex===t&&u.push(e)})),(c=e.intersectObjects(u).map((function(e){return{face:e.face?{normal:e.face.normal}:void 0,point:e.point,distance:e.distance}}))).length&&l.push.apply(l,c)}},h=this,d=0,p=c;d<p.length;d++){u(p[d])}return l.filter((function(t){var n=t.distance;return n<=e.far&&n>=e.near})).sort((function(e,t){return e.distance-t.distance}))},t.prototype.buildBVH=function(){if(!this.bvhs.loaded&&this.originModel){var e=[];this.originModel.traverse((function(t){t instanceof je&&(e[t.floorIndex]=e[t.floorIndex]||[],e[t.floorIndex].push(t.geometry))})),this.bvhs.length=0;for(var t=0,n=e;t<n.length;t++){var i=n[t],r=0;if(i){for(var o=0,a=i;o<a.length;o++){var s=0;s=(d=a[o]).index?d.index.array.length:d.attributes.position.array.length/3,r+=3*Math.floor(s/3)}for(var l=new Float32Array(3*r),c=0,u=0,h=i;u<h.length;u++){var d,p=(d=h[u]).attributes.position.array,f=d.index?d.index.array:null;if(f){for(var A=3*Math.floor(f.length/3),v=0,m=void 0,g=void 0;v<A;v++)m=3*(c+v),g=3*f[v],l[m]=p[g],l[m+1]=p[g+1],l[m+2]=p[g+2];c+=A}else{for(A=3*Math.floor(p.length/3/3),v=0,m=void 0,g=void 0;v<A;v++)g=3*v,l[m=3*(c+v)]=p[g],l[m+1]=p[g+1],l[m+2]=p[g+2];c+=A}}var y=(new Xt).create(l).splitNode(200);this.bvhs.push(y)}}this.bvhs.loaded=!0,this.emit("bvhLoaded")}},t.prototype.load=function(e,t,n){var i=this;if(void 0===t&&(t={}),void 0===n&&(n={}),!0===this.loaded)throw new Error("[MODEL LOAD ERROR]: model cannot load twice.");var r=function(e,t){if(void 0===t&&(t=[]),/^blob\:/.test(e))return"at3d";var n=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(e);if(!n)return"";for(var i=0,r=String(n[1]).trim().split(".").slice(1).reverse();i<r.length;i++){var o=r[i],a=t.indexOf(o);if(a>=0)return t[a]}return""}(e.file,Object.keys(Xi)),o=Xi[r];if(!o)throw new Error("[MODEL LOAD ERROR]: file type(".concat(r,") does not support."));return this.name=e.file,this.textureOptions=t,o(e,{textureOptions:t,allowHosts:this.allowHosts,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe,renderer:this.renderer}).then((function(t){var r=t.createAt,o=t.description,a=t.objects,s=t.texturePromise,l=t.updateTexture;i.userData.createAt=r,i.userData.description=o,i.updateTexture=function(e){var t=this;return this.textureOptions=e,l(this.textureOptions).then((function(){t.needsRender=!0}))},i.bounding.makeEmpty();var c=i.originModel=new Ke;c.renderOrder=-4;for(var u=0,h=a;u<h.length;u++){var d=h[u];d.traverse((function(e){if(e instanceof je){var t=e.geometry;t.boundingBox||t.computeBoundingBox(),t.boundingSphere||t.computeBoundingSphere(),i.bounding.union(t.boundingBox)}})),c.add(d)}if(i.add(c),i.floorLength=i.hasFloors_(),i.empty=!1,i.loaded=!0,e.tiles&&e.tiles.tileset_url&&e.tiles.b3md_mappings_url){var p=i.tiledModel=new ji({onNodeCreated:function(e){var t=c.getMaterial();t&&(e.setMaterial(t),e.renderOrder=-4)},allowHosts:i.allowHosts,networkSubscribe:i.networkSubscribe,requestProxy:i.requestProxy,maxDepth:n.maxDepth},i.originModel,i.renderer);p.renderOrder=-4,i.add(p),p.load(e.tiles);for(var f=function(e){i.tiledModel.listener.on(e,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];i.emit.apply(i,oe([e],t,!1))}))},A=0,v=Hi;A<v.length;A++){f(v[A])}}e.bvh&&i.buildBVH(),$t((function(){i.emit("geometryLoaded"),s.then((function(){i.emit("materialLoaded"),i.emit("loaded")}))}))})).catch((function(e){return i.name="",i.emit("error",e),Promise.reject(e)}))},t.prototype.update=function(e,t){if(this.originModel){var n=this.originModel.visible;if(this.tiledModel&&this.tiledModel.enable&&this.tiledModel.tileset){this.tiledModel.update(e,t);var i=this.tiledModel.tileset.root;i.content&&"READY"===i.contentState&&!1!==n&&(this.setTransparent(!1),this.shownFloor&&this.show(this.shownFloor),this.originModel.visible=!1,this.originModel.needsRender=!0)}else!0!==n&&(this.originModel.visible=!0,this.originModel.needsRender=!0)}},t.prototype.dispose=function(){this.off();var e=this.originModel,t=this.tiledModel;if(t&&(t.enable=!1,t.reset()),e)for(e.disposeGeometry(),e.disposeMaterial();e.children.length;)e.remove(e.children[0]);this.bvhs.length=0,this.bvhs.loaded=!1},t}(Ke);Object.assign(Yi.prototype,{on:ce.prototype.on,once:ce.prototype.once,off:ce.prototype.off,emit:ce.prototype.emit,hasListener:ce.prototype.hasListener});var Zi="Panorama";function Ji(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,i,r;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(i=n;0!=i--;)if(!Ji(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;0!=i--;){var o=r[i];if(!Ji(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $i(e){return"number"==typeof e}function er(e){return 0==(e&e-1)&&0!==e}var tr=function(){return new Error("Invalid input.")},nr=function(){return new Error("Invalid certificate.")},ir=function(){return new Error("Invalid signature.")},rr=function(e){return new Error("date(".concat(e.toString(),") expired."))},or=function(e){return new Error("host(".concat(JSON.stringify(e),") is not allowed."))};function ar(e,t){void 0===t&&(t=!1);var n=typeof e;if("string"===n)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 i="[",r=e.length-1,o=0;o<r;o++)i+=ar(e[o],!1)+",";return r>-1&&(i+=ar(e[o],!1)),i+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return ar(e.toJSON(),t);var a=Object.keys(e).sort(),s=a.length;for(i="",o=0;o<s;){var l=a[o],c=ar(e[l],!0);void 0!==c&&(o&&""!==i&&(i+=","),i+=JSON.stringify(l)+":"+c),o++}return"{"+i+"}"}switch(n){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(e)?e:null}}function sr(e){return String(ar(e,!1))}function lr(e){var t,n,i;if(Array.isArray(e)){var r,o,a=void 0;if(e.length<=0)return tr();for(var s=function(t){var n=lr(e[t]);if(n instanceof Error)return{value:n};if(a){if(a!==n.issuer)return{value:nr()}}else a=n.issuer;r?n.expire.getTime()<r.getTime()&&(r=n.expire):r=n.expire,o=o?o.filter((function(e){return-1!==n.allowHosts.indexOf(e)})):n.allowHosts},l=0;l<e.length;l++){var c=s(l);if("object"==typeof c)return c.value}return pe({issuer:a,expire:r,allowHosts:o})}var u=JSON.parse(e),h="undefined"!=typeof location?location.hostname:"",d=Date.now();if("object"!=typeof u)return tr();var p=new Date("string"==typeof u.expire_at&&/^\d+$/.test(u.expire_at)?Number(u.expire_at):u.expire_at),f=Array.isArray(u.allow_hosts)?u.allow_hosts:[];if(0===h.length||Ae(h)||ge.filter((function(e){return ve(e,h)})).length>0){var A=String(null!==(t=u.certificate)&&void 0!==t?t:"");if(A){var v=new Y;return v.readCertPEM(A),pe({issuer:v.getSubjectString(),expire:p,allowHosts:f})}return pe({issuer:"none",expire:p,allowHosts:f})}var m=String(null!==(n=u.certificate)&&void 0!==n?n:"");if(!m)return nr();var g=new Y;g.readCertPEM(m);var y=String(null!==(i=u._signature)&&void 0!==i?i:"");if(!y)return ir();var b=sr(function(e,t){for(var n={},i=0,r=Object.keys(e);i<r.length;i++){var o=r[i];-1===t.indexOf(o)&&(n[o]=e[o])}return n}(u,["_signature"]));return!1===function(e,t,n){var i=new Y;if("string"==typeof n?i.readCertPEM(n):i.readCertHex(n.hex),!1===te(i))return!1;var r=new I;return r.readCertPubKeyHex(i.hex,6),!!r.verify(e,M(t))}(b,y,g)?ir():d<p.getTime()?0===f.filter((function(e){return ve(e,h)})).length?or(h):pe({issuer:g.getSubjectString(),expire:p,allowHosts:f}):rr(p)}var cr=new WeakMap,ur=function(){function e(){this.name="",this.workCode="",this.expire=new Date,this.allowHosts=[],this.initial={mode:Zi,latitude:0,longitude:0,panoIndex:0,fov:80},this.observers=[],this.boundingBox=new i.Box3,this.issuer="none",this.raw={works:[""],options:""}}return e.prototype.toJSON=function(){return this.raw.works},e.parse=fr,e}();function hr(e){return null==e?"null":Array.isArray(e)?"array":"object"==typeof e?"dict":"value"}function dr(e,t){var n=hr(e),i=hr(t);if("null"===i)return e;if("value"===i)return t;if(i!==n)return JSON.parse(JSON.stringify(t));if("array"===i)for(var r=0;r<t.length;r++)e[r]=dr(e[r],t[r]);else if("dict"===i)for(var o in t)e[o]=dr(e[o],t[o]);return e}function pr(e,t,n){for(var r,o=JSON.stringify(t),a=[],s=0,l=[].concat(e);s<l.length;s++){var c=l[s];c instanceof ur?a.push.apply(a,c.raw.works):"string"==typeof c?a.push(c):a.push(JSON.stringify(c))}var u=lr(a);if(u instanceof Error)return u;t=JSON.parse(o),e=a.map((function(e){return JSON.parse(e)})).reduce((function(e,t){return dr(e,t)}));var h=new ur;if(u instanceof Error)return u;h.issuer=u.issuer,h.expire=u.expire,h.allowHosts=u.allowHosts,h.raw={works:a,options:o};var d=null!==(r=e.base_url)&&void 0!==r?r:"";d&&"/"!==d[d.length-1]&&(d+="/");var p=function(e,t){return 0===e.indexOf(t)},f=function(e,i){var r,o=e;if(!0===t.jsonp){o=e.replace(/([\?\#].*)?$/i,"");var a=Z("".concat(o)).slice(0,7);o="".concat(o,".").concat(a,".jsonp")}if(!0===t.shortPath){var s=o.replace(d,"").split("."),l=null!==(r=s.shift())&&void 0!==r?r:"",c=s.join(".");o=xn(d,Z(l))+(c?"."+c:"")}var u=o.replace(d,"");return t.baseURL&&(o=xn(t.baseURL,u)),n&&n(e,o,u,i),o},A=function(t,n){var i,r,o,a,s,l,c=t;if(!On(t)){var u=null!==(l=null!==(a=null!==(r=null===(i=e.panorama)||void 0===i?void 0:i.pano_high_cube_base_url)&&void 0!==r?r:null===(o=e.panorama)||void 0===o?void 0:o.pano_cube_base_url)&&void 0!==a?a:null===(s=e.panorama)||void 0===s?void 0:s.base_url)&&void 0!==l?l:"";u&&(u=xn(u,String(n))),c=xn(u,c)}return On(c)||(c=xn(d,c)),p(c,d)||console.warn("".concat(c," is not start with base_url(").concat(d,").")),f(c,"panorama")},v=function(e){var t=e;return On(t)||(t=xn(d,e)),p(t,d)||console.warn("".concat(t," is not start with base_url(").concat(d,").")),f(t,"model")},m=function(e,t){void 0===t&&(t="");var n=e;return On(n)||(n=xn(t,n)),On(n)||(n=xn(d,n)),p(n,d)||console.warn("".concat(n," is not start with base_url(").concat(d,").")),f(n,"texture")};if(u instanceof Error)return u;if(h.workCode=String(e.work_code||e.code||e.vr_code||e.workCode),h.name=String(e.name),u instanceof Error)return u;if(e.model){var g={bvh:!0,async:!1,textureBase:"",textures:[]};"boolean"==typeof t.modelBvh?g.bvh=t.modelBvh:"boolean"==typeof e.model.bvh?g.bvh=e.model.bvh:"boolean"==typeof e.bvh&&(g.bvh=e.bvh),e.model.file?g.file=v(e.model.file):e.model.file_url&&(g.file=v(e.model.file_url)),e.model.textureBase?g.textureBase=m("",e.model.textureBase):e.model.material_base_url?g.textureBase=m("",e.model.material_base_url):g.file&&(g.textureBase=g.file.split("/").slice(0,-1).join("/").replace("/model/","/materials/")),Array.isArray(e.model.textures)?g.textures=e.model.textures.map((function(t){var n,i;return m(t,null!==(i=null!==(n=e.model.textureBase)&&void 0!==n?n:e.model.material_base_url)&&void 0!==i?i:"")})):Array.isArray(e.model.material_textures)&&(g.textures=e.model.material_textures.map((function(t){var n,i;return m(t,null!==(i=null!==(n=e.model.textureBase)&&void 0!==n?n:e.model.material_base_url)&&void 0!==i?i:"")}))),e.model.tiles&&(g.tiles=e.model.tiles),g.file&&(h.model=g)}if(u instanceof Error)return u;if(e.observers&&Array.isArray(e.observers)){var y=[];e.panorama&&(Array.isArray(e.panorama)?y=e.panorama:Array.isArray(e.panorama.list)?y=e.panorama.list:Array.isArray(e.panorama.info)&&(y=e.panorama.info));for(var b=0;b<e.observers.length;b++){var x={},w=e.observers[b];if(!w)break;var M=y[b];if(!M)break;w=Object.assign({},w,M,{active:!1!==w.active&&!1!==M.active}),x.panoIndex=b,x.active=!1!==w.active,x.loadable=!0===w.loadable,x.derivedId=w.derived_id,x.images={up:A(w.images?w.images.up:w.up,b),down:A(w.images?w.images.down:w.down,b),right:A(w.images?w.images.right:w.right,b),left:A(w.images?w.images.left:w.left,b),front:A(w.images?w.images.front:w.front,b),back:A(w.images?w.images.back:w.back,b)};var C=w.images?w.images.depth:w.depth;C&&(x.images.depth=A(C,b));var E=w.images?w.images.luminance:w.luminance;E&&(x.images.luminance={up:A(E.up,b),down:A(E.down,b),right:A(E.right,b),left:A(E.left,b),front:A(E.front,b),back:A(E.back,b)});var I=w.images?w.images.tiles:w.tiles;if(I){for(var S=[],B=function(e){var t=e.match(/\/cube_(\d+)\//);if(t){var n=Number(t[1]);if(er(n))return n}return!1},T=function(e,t){return e.replace(/\/cube_(\d+)\//,(function(){return"/cube_".concat(t,"/")}))},P=0,R=I;P<R.length;P++){var L=R[P];if("number"==typeof L){var O=L,F=B(x.images.front);if(!1===F)continue;if((z=Math.max(F,512*Math.pow(2,O)))>2048){var k=T(x.images.up,z),D=T(x.images.down,z),Q=T(x.images.right,z),N=T(x.images.left,z),V=T(x.images.front,z),U=T(x.images.back,z);S.push({level:O,size:z,up:k,down:D,right:Q,left:N,front:V,back:U})}else{k=x.images.up,D=x.images.down,Q=x.images.right,N=x.images.left,V=x.images.front,U=x.images.back;S.push({level:O,size:z,up:k,down:D,right:Q,left:N,front:V,back:U})}}else{var z;if("number"!=typeof(O=L.level))continue;if("number"!=typeof(z=L.size))continue;k=A(L.up,b),D=A(L.down,b),Q=A(L.right,b),N=A(L.left,b),V=A(L.front,b),U=A(L.back,b);S.push({level:O,size:z,up:k,down:D,right:Q,left:N,front:V,back:U})}}S.sort((function(e,t){return e.level-t.level})),x.images.tiles=S}if(w.position instanceof i.Vector3)x.position=w.position.clone();else{if(!Array.isArray(w.position))break;x.position=(new i.Vector3).fromArray(w.position)}if(w.standingPosition instanceof i.Vector3)x.standingPosition=w.standingPosition.clone();else if(Array.isArray(w.standingPosition))x.standingPosition=(new i.Vector3).fromArray(w.standingPosition);else if(w.standing_position instanceof i.Vector3)x.standingPosition=w.standing_position.clone();else{if(!Array.isArray(w.standing_position))break;x.standingPosition=(new i.Vector3).fromArray(w.standing_position)}if(w.quaternion instanceof i.Quaternion)x.quaternion=w.quaternion.clone();else if(Array.isArray(w.quaternion))x.quaternion=(new i.Quaternion).fromArray(w.quaternion);else{if(!w.quaternion)break;var q=w.quaternion,H=q.x,_=q.y,j=q.z,K=q.w;x.quaternion=new i.Quaternion(H,_,j,K)}if(Array.isArray(w.accessibleNodes)?x.accessibleNodes=w.accessibleNodes.slice():Array.isArray(w.accessible_nodes)&&(x.accessibleNodes=w.accessible_nodes.slice()),Array.isArray(w.visibleNodes)?x.visibleNodes=w.visibleNodes.slice():Array.isArray(w.visible_nodes)&&(x.visibleNodes=w.visible_nodes.slice()),$i(w.floorIndex)?x.floorIndex=w.floorIndex:$i(w.floor_index)?x.floorIndex=w.floor_index:x.floorIndex=0,w.video){var G={};"string"==typeof w.video.source&&(G.source=w.video.source),w.video.matrix instanceof i.Matrix4?G.matrix=w.video.matrix.clone():Array.isArray(w.video.matrix)&&(G.matrix=(new i.Matrix4).fromArray(w.video.matrix)),w.video.size instanceof i.Vector2?G.size=w.video.size.clone():Array.isArray(w.video.size)&&(G.size=(new i.Vector2).fromArray(w.video.size)),G.source&&G.matrix&&G.size&&(x.video=G)}h.observers[b]=x}}if(u instanceof Error)return u;for(var W=0,X=h.observers;W<X.length;W++){if((x=X[W]).accessibleNodes)x.accessibleNodes=x.accessibleNodes.filter((function(e){return e<h.observers.length}));else{x.accessibleNodes=[];for(var Y=0;Y<h.observers.length;Y++)h.observers[Y]!==x&&x.accessibleNodes.push(Y)}if(x.visibleNodes)x.visibleNodes=x.visibleNodes.filter((function(e){return e<h.observers.length}));else{x.visibleNodes=[];for(Y=0;Y<h.observers.length;Y++)h.observers[Y]!==x&&x.visibleNodes.push(Y)}}if(u instanceof Error)return u;if(e.initial)if("Floorplan"!==e.initial.mode&&"Topview"!==e.initial.mode&&"Panorama"!==e.initial.mode&&"VRPanorama"!==e.initial.mode&&"Model"!==e.initial.mode&&"DepthPanorama"!==e.initial.mode||(h.initial.mode=e.initial.mode),$i(e.initial.latitude)&&(h.initial.latitude=e.initial.latitude),$i(e.initial.longitude)?h.initial.longitude=e.initial.longitude:$i(e.initial.heading)&&(h.initial.longitude=-(360*(e.initial.heading-.25)+90)/180*Math.PI),$i(e.initial.fov)&&(h.initial.fov=e.initial.fov),$i(e.initial.panoIndex)){var J=h.observers.length>0?h.observers.length-1:0;h.initial.panoIndex=Gt(e.initial.panoIndex,0,J)}else if($i(e.initial.pano_index)){J=h.observers.length>0?h.observers.length-1:0;h.initial.panoIndex=Gt(e.initial.pano_index,0,J)}else if($i(e.initial.pano)){J=h.observers.length>0?h.observers.length-1:0;h.initial.panoIndex=Gt(e.initial.pano,0,J)}if(u instanceof Error)return u;h.boundingBox.makeEmpty();for(var $=0,ee=h.observers;$<ee.length;$++){x=ee[$];h.boundingBox.expandByPoint(x.standingPosition),h.boundingBox.expandByPoint((new i.Vector3).fromArray([x.position.x,2*x.position.y-x.standingPosition.y,x.position.z]))}if(u instanceof Error)return u;var te=pe(h);return cr.set(te,{works:a,options:o}),te}function fr(e,t,n){"string"==typeof e&&"{"===e.trim()[0]&&(e=JSON.parse(e));var i=cr.get(e);if(i){if(t&&!Ji(JSON.parse(i.options),t))throw new Error("[PARSE FAILED]: work is parsed with different options.");return e}var r=pr(e,null!=t?t:{},n);if(r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+"\nError work input:\n"+JSON.stringify(e));return r}function Ar(e,t,n){return e+(t-e)*n}function vr(e,t){var n=t[1]-t[0];return e<t[0]?vr(e+n,t):e>=t[1]?vr(e-n,t):e}function mr(e,t,n,i){return i?function(e,t,n,i){var r=i[1]-i[0];return e=vr(e,i),Ar((t=vr(t,i))-e>r/2?e+r:e-t>r/2?e-r:e,t,n)}(e,t,n,i):Ar(e,t,n)}var gr=function(){function e(e){for(var t in this.config={},this.progress=1,this.ended=!0,this.value={},this.startTime=de(),this.startVelocity=0,this.duration=0,this.keyframes=[],e){var n=e[t];"number"==typeof n?(this.value[t]=n,this.config[t]={circle:!1}):(this.value[t]=n.value,this.config[t]={circle:n.circle})}this.keyframes=[{progress:0,value:re({},this.value)},{progress:1,value:re({},this.value)}]}return e.prototype.getProgress=function(e){var t=e-this.startTime;return t<0?0:t>=this.duration?1:1-function(e,t,n,i){var r=(t*n+2*e)/Math.pow(n,3),o=-(2*t*n+3*e)/Math.pow(n,2),a=t,s=e;return r*Math.pow(i,3)+o*Math.pow(i,2)+a*i+s}(1,this.startVelocity,this.duration,t)},e.prototype.getValue=function(e){for(var t=1;t<this.keyframes.length;t++)if(this.keyframes[t].progress>e){var n=this.keyframes[t-1],i=this.keyframes[t],r={};for(var o in this.config){var a=(e-n.progress)/(i.progress-n.progress);r[o]=mr(n.value[o],i.value[o],a,this.config[o].circle)}return r}return re({},this.keyframes[this.keyframes.length-1].value)},e.prototype.getProgressVelocity=function(e){var t=e-this.startTime;return t>=this.duration?0:function(e,t,n,i){var r=(t*n+2*e)/Math.pow(n,3),o=-(2*t*n+3*e)/Math.pow(n,2),a=t;return 3*r*Math.pow(i,2)+2*o*i+a}(1,this.startVelocity,this.duration,t)},e.prototype.update=function(e){return!!this.ended||(this.progress=Math.min(1,Math.max(0,this.progress,this.getProgress(e))),this.value=this.getValue(this.progress),this.ended=this.progress>=1,this.ended&&this.callbacks&&(this.callbacks[0](),this.callbacks=void 0),this.ended)},e.prototype.getKeyFrameSegment=function(e){for(var t=this.getProgress(e),n=1;n<this.keyframes.length;n++)if(this.keyframes[n].progress>t)return[this.keyframes[n-1],this.keyframes[n]];return[this.keyframes[this.keyframes.length-2],this.keyframes[this.keyframes.length-1]]},e.prototype.getTargetKeyframe=function(){return this.keyframes[this.keyframes.length-1]},e.prototype.set=function(e,t,n,i){var r;void 0===n&&(n=0),isNaN(t)&&(t=0),isNaN(n)&&(n=0),i=null!=i?i:de();var o=this.getProgress(i),a=this.getValue(o),s={};for(var l in this.config)s[l]=null!==(r=e[l])&&void 0!==r?r:a[l];var c=[{progress:0,value:a},{progress:1,value:s}];return this.setKeyframes(c,t,n,i)},e.prototype.setKeyframes=function(e,t,n,i){var r=this;if(void 0===n&&(n=0),e.length<2)throw new Error("keyframes invalid.");return isNaN(t)&&(t=0),isNaN(n)&&(n=0),this.callbacks&&(this.callbacks[1](new Error("motion aborted.")),this.callbacks=void 0),new Promise((function(o,a){i=null!=i?i:de(),r.progress=0,r.ended=!1,r.startTime=i,r.startVelocity=n,r.keyframes=e,r.duration=t,0===t?(r.progress=1,r.value=re({},e[e.length-1].value)):r.value=re({},e[0].value),r.callbacks=[o,a]}))},e.prototype.dispose=function(){this.callbacks&&(this.callbacks[1](new Error("motion dispose.")),this.callbacks=void 0)},e}(),yr=function(e){return e*(2-e)},br=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),n=new Uint8Array([0,2,1,2,3,1]),r=new i.BufferGeometry;return r.setAttribute("position",new i.BufferAttribute(e,3)),r.setAttribute("uv",new i.BufferAttribute(t,2)),r.setIndex(new i.BufferAttribute(n,1)),r}(),xr=function(e){function t(t){void 0===t&&(t={});var n,r,o=this;o=e.call(this)||this;var a=null!==(n=t.color)&&void 0!==n?n:16777215,s=null!==(r=t.scale)&&void 0!==r?r:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new gr({progress:0}),o.ringMotion=new gr({scale:1,opacity:1}),o.tapMotion=new gr({scale:1,opacity:1}),o.loadingOpacityMotion=new gr({opacity:0}),o.progressMotion=new gr({progress:0}),o.progressOpacityMotion=new gr({opacity:0}),o.opacityMotion=new gr({opacity:0}),o.disableMotion=new gr({progress:0}),o.panoMesh=new i.Mesh(br,new i.ShaderMaterial({blending:i.CustomBlending,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float ringScale;\nuniform float ringOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\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.8 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)) * 1.5, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * inside(0.15 * circleScale * tapScale) * outside(0.234 * circleScale * tapScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\n}\n\nvec4 create_ring() {\n float gradient = clamp(0.5 + abs(dot(normalize(vec2(1.0, 1.0)), vUv - CENTER)), 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * ringOpacity * inside(0.27 * ringScale * tapScale) * outside(0.32 * ringScale * tapScale));\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.4 + 0.1;\n return vec4(1.0, 1.0, 1.0, gradient * tapOpacity * loadingOpacity * inside(0.208 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.5;\n return vec4(1.0, 1.0, 1.0, bar * tapOpacity * progressOpacity * inside(0.208 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.2 + (0.43 - 0.2) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.2 + (0.43 - 0.2) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.a);\n\n vec4 loadingColor = create_loading();\n gl_FragColor = mix(gl_FragColor, loadingColor, loadingColor.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 ringColor = create_ring();\n gl_FragColor = mix(gl_FragColor, ringColor, ringColor.a);\n\n gl_FragColor = mix(gl_FragColor, create_disable(), disable);\n\n gl_FragColor = vec4(gl_FragColor.rgb * baseColor, gl_FragColor.a * opacity * opacity);\n}\n",uniforms:{baseColor:{value:new i.Color(a)},circleScale:{value:1},ringScale:{value:1},ringOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(s,1,s),o.add(o.panoMesh),o.currentStartTime=de(),o.needsRender=!0,o}return ie(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Gt(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(ue),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(ue).then((function(){t.progressMotion.set({progress:0},0).catch(ue)})):this.progressMotion.set({progress:Gt(1.2*e,0,1)},100).catch(ue)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Gt(e,0,1),this.opacityMotion.set({opacity:e},200).catch(ue))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(ue),this.current=e,!0===this.current&&(this.currentStartTime=de()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(ue))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(ue))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(ue),this.progressMotion.set({progress:0},0).catch(ue),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(ue),e.progressMotion.set({progress:e.progress},120).catch(ue)})).catch(ue)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var n=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=n,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var i=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=i,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);i=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=i,this.needsRender=!0}if((!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var r=(e-this.currentStartTime-1500)/2e3;if(r%5<2){var o=1+Math.sin(Math.PI*r)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=o,this.needsRender=!0}var a=(e-this.currentStartTime-1500)/2e3;if(a%5<2){var s=a%1;this.panoMesh.material.uniforms.expand0.value=yr(s)*this.currentMotion.value.progress,this.needsRender=!0}var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){s=l%1;this.panoMesh.material.uniforms.expand1.value=yr(s)*this.currentMotion.value.progress,this.needsRender=!0}}this.currentMotion.value.progress>.2&&0===this.progress&&!1===this.loading?(e-this.currentStartTime-1e3)/2e3%5<2?.8!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:.8,opacity:0},600).catch(ue):1!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:1,opacity:1},600).catch(ue):1!==this.ringMotion.getTargetKeyframe().value.scale&&this.ringMotion.set({scale:1,opacity:1},600).catch(ue);if(!this.ringMotion.ended){var c=this.ringMotion.value;o=c.scale,i=c.opacity;this.ringMotion.update(e),this.panoMesh.material.uniforms.ringScale.value=o,this.panoMesh.material.uniforms.ringOpacity.value=i,this.needsRender=!0}if(!this.disableMotion.ended){n=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=n,this.needsRender=!0}},t.prototype.dispose=function(){this.ringMotion.dispose(),this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(i.Object3D),wr=function(e){return e*(2-e)},Mr=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),n=new Uint8Array([0,2,1,2,3,1]),r=new i.BufferGeometry;return r.setAttribute("position",new i.BufferAttribute(e,3)),r.setAttribute("uv",new i.BufferAttribute(t,2)),r.setIndex(new i.BufferAttribute(n,1)),r}(),Cr=function(e){function t(t){void 0===t&&(t={});var n,r,o=this;o=e.call(this)||this;var a=null!==(n=t.color)&&void 0!==n?n:16777215,s=null!==(r=t.scale)&&void 0!==r?r:1;return o.progress=0,o.opacity=0,o.loading=!1,o.current=!1,o.disabled=!1,o.currentMotion=new gr({progress:0}),o.tapMotion=new gr({scale:1,opacity:1}),o.loadingOpacityMotion=new gr({opacity:0}),o.progressMotion=new gr({progress:0}),o.progressOpacityMotion=new gr({opacity:0}),o.opacityMotion=new gr({opacity:0}),o.disableMotion=new gr({progress:0}),o.panoMesh=new i.Mesh(Mr,new i.ShaderMaterial({blending:i.CustomBlending,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor,depthWrite:!1,vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\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 return vec4(1.0, 1.0, 1.0, 0.8 * circleOpacity * tapOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(1.0, 1.0, 1.0, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\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 * tapOpacity * loadingOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.7;\n return vec4(1.0, 1.0, 1.0, bar * tapOpacity * progressOpacity * inside(0.2 * circleScale * tapScale) * outside(0.3 * circleScale * tapScale));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.25 + (0.5 - 0.25) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.25 + (0.48 - 0.25) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(1.0, 1.0, 1.0, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(1.0, 1.0, 1.0, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.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 * baseColor, gl_FragColor.a * opacity * opacity);\n}\n",uniforms:{baseColor:{value:new i.Color(a)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0}}})),o.renderOrder=-2,o.panoMesh.renderOrder=-2,o.panoMesh.position.y=.004,o.panoMesh.scale.set(s,1,s),o.add(o.panoMesh),o.currentStartTime=de(),o.needsRender=!0,o}return ie(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Gt(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(ue),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(ue).then((function(){t.progressMotion.set({progress:0},0).catch(ue)})):this.progressMotion.set({progress:Gt(1.2*e,0,1)},100).catch(ue)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Gt(e,0,1),this.opacityMotion.set({opacity:e},200).catch(ue))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(ue),this.current=e,!0===this.current&&(this.currentStartTime=de()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(ue))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(ue))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(ue),this.progressMotion.set({progress:0},0).catch(ue),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(ue),e.progressMotion.set({progress:e.progress},120).catch(ue)})).catch(ue)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var n=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=n,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var i=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=i,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);i=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=i,this.needsRender=!0}if((!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var r=(e-this.currentStartTime-1500)/2e3;if(r%5<2){var o=1+Math.sin(Math.PI*r)/25*this.currentMotion.value.progress;this.panoMesh.material.uniforms.circleScale.value=o,this.needsRender=!0}var a=(e-this.currentStartTime-1500)/2e3;if(a%5<2){var s=a%1;this.panoMesh.material.uniforms.expand0.value=wr(s)*this.currentMotion.value.progress,this.needsRender=!0}var l=(e-this.currentStartTime-1e3)/2e3;if(l%5<2){s=l%1;this.panoMesh.material.uniforms.expand1.value=wr(s)*this.currentMotion.value.progress,this.needsRender=!0}}if(!this.disableMotion.ended){n=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=n,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(i.Object3D),Er=function(e){return e*(2-e)},Ir=function(){var e=new Float32Array([-.18,0,-.18,.18,0,-.18,-.18,0,.18,.18,0,.18]),t=new Float32Array([1,0,0,0,1,1,0,1]),n=new Uint8Array([0,2,1,2,3,1]),r=new i.BufferGeometry;return r.setAttribute("position",new i.BufferAttribute(e,3)),r.setAttribute("uv",new i.BufferAttribute(t,2)),r.setIndex(new i.BufferAttribute(n,1)),r}(),Sr=function(e){function t(t){void 0===t&&(t={});var n,r,o,a,s,l,c,u=this;u=e.call(this)||this;var h=null!==(n=t.color)&&void 0!==n?n:16777215,d=null!==(r=t.scale)&&void 0!==r?r:1,p=t.map,f=null!==(o=t.mapAlpha)&&void 0!==o?o:1,A=null!==(a=t.mapUseColor)&&void 0!==a&&a,v=null!==(s=t.mapUseReverse)&&void 0!==s&&s,m=null!==(l=t.borderWidth)&&void 0!==l?l:.1,g=null!==(c=t.borderColor)&&void 0!==c?c:16777215;return u.progress=0,u.opacity=0,u.loading=!1,u.current=!1,u.disabled=!1,u.currentMotion=new gr({progress:0}),u.tapMotion=new gr({scale:1,opacity:1}),u.loadingOpacityMotion=new gr({opacity:0}),u.progressMotion=new gr({progress:0}),u.progressOpacityMotion=new gr({opacity:0}),u.opacityMotion=new gr({opacity:0}),u.disableMotion=new gr({progress:0}),u.panoMesh=new i.Mesh(Ir,new i.ShaderMaterial({blending:i.CustomBlending,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor,depthWrite:!1,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_MAP)\nuniform sampler2D map;\nuniform float mapAlpha;\n#endif\n#if defined(USE_BORDER)\nuniform float borderWidth;\nuniform vec3 borderColor;\n#endif\nuniform vec3 baseColor;\nuniform float circleScale;\nuniform float circleOpacity;\nuniform float loadingAngle;\nuniform float loadingOpacity;\nuniform float progress;\nuniform float progressOpacity;\nuniform float expand0;\nuniform float expand1;\nuniform float expandOpacity;\nuniform float opacity;\nuniform float tapScale;\nuniform float tapOpacity;\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 radius = 0.3 * circleScale * tapScale;\n #if defined(USE_MAP)\n float delta = radius / 0.5;\n vec2 deltaUv = (vUv - CENTER) / delta + CENTER;\n vec4 image = texture2D(map, deltaUv);\n image.a = image.a * mapAlpha;\n #if defined(USE_COLOR)\n image = vec4(baseColor, 1.0) * image;\n #endif\n #endif\n #if defined(USE_REVERSE)\n image = vec4(baseColor, 1.0 - image.a);\n #else\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n float clipAlpha = inside(radius - borderDist * radius);\n float gradient = clamp(borderWidth * 2.0 + abs(dot(normalize(vec2(1.0, -1.0)), vUv - CENTER)), 0.0, 1.0);\n vec4 borderColor = vec4(borderColor, clipAlpha * gradient);\n image = mix(borderColor, image, image.a);\n #endif\n #endif\n return vec4(image.rgb, image.a * circleOpacity * tapOpacity * outside(radius));\n}\n\nvec4 create_disable() {\n float dist = length(CENTER - vUv);\n return vec4(baseColor, 0.5 * tapOpacity * outside(0.32 * circleScale * tapScale));\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 float radius = 0.3 * circleScale * tapScale;\n float inner = inside(radius - 0.2 * radius);\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n inner = inside(radius - borderDist * radius);\n #endif\n return vec4(baseColor, gradient * tapOpacity * loadingOpacity * inner * outside(radius));\n}\n\nvec4 create_progress() {\n float angle = PI + atan(CENTER.x - vUv.x, CENTER.y - vUv.y);\n float bar = (1.0 - step(progress * TAU, angle)) * 0.7;\n float radius = 0.3 * circleScale * tapScale;\n float inner = inside(radius - 0.2 * radius);\n #if defined(USE_BORDER)\n float borderDist = clamp(borderWidth, 0.0, 1.0);\n inner = inside(radius - borderDist * radius);\n #endif\n return vec4(baseColor, bar * tapOpacity * progressOpacity * inner * outside(radius));\n}\n\nvec4 create_expand0() {\n float width = 0.2;\n float radius = 0.25 + (0.5 - 0.25) * expand0;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand0 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(baseColor, gradient * expandOpacity * outside(radius));\n}\n\nvec4 create_expand1() {\n float width = 0.2;\n float radius = 0.25 + (0.48 - 0.25) * expand1;\n float dist = length(CENTER - vUv);\n float gradient = (1.0 - clamp((radius - dist) / width, 0.0, 1.0)) * 0.8 * clamp((1.0 - abs(expand1 - 0.5) * 2.0) * 1.2, 0.0, 1.0);\n return vec4(baseColor, gradient * expandOpacity * outside(radius));\n}\n\nvoid main() {\n gl_FragColor = vec4(baseColor, 0);\n\n vec4 expand1Color = create_expand1();\n gl_FragColor = mix(gl_FragColor, expand1Color, expand1Color.a);\n\n vec4 expand0Color = create_expand0();\n gl_FragColor = mix(gl_FragColor, expand0Color, expand0Color.a);\n\n vec4 circleColor = create_circle();\n gl_FragColor = mix(gl_FragColor, circleColor, circleColor.a);\n\n vec4 progressColor = create_progress();\n gl_FragColor = mix(gl_FragColor, progressColor, progressColor.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",defines:{USE_COLOR:A,USE_MAP:void 0!==p,USE_BORDER:m>0,USE_REVERSE:v},uniforms:{baseColor:{value:new i.Color(h)},circleScale:{value:1},circleOpacity:{value:1},loadingAngle:{value:0},loadingOpacity:{value:0},progress:{value:0},progressOpacity:{value:0},expand0:{value:0},expand1:{value:0},expandOpacity:{value:0},opacity:{value:0},tapScale:{value:1},tapOpacity:{value:1},disable:{value:0},map:{value:p},mapAlpha:{value:f},borderWidth:{value:m},borderColor:{value:new i.Color(g)}}})),u.renderOrder=-2,u.panoMesh.renderOrder=-2,u.panoMesh.position.y=.004,u.panoMesh.scale.set(d,1,d),u.add(u.panoMesh),u.currentStartTime=de(),u.needsRender=!0,u}return ie(t,e),t.prototype.setProgress=function(e){var t=this;this.setDisabled(!1),this.setLoading(!1),this.progress!==e&&(e=Gt(e,0,1),this.tapMotion.ended&&(0===this.progress&&this.progressOpacityMotion.set({opacity:1},500).catch(ue),0===e?this.progressOpacityMotion.set({opacity:0},500).catch(ue).then((function(){t.progressMotion.set({progress:0},0).catch(ue)})):this.progressMotion.set({progress:Gt(1.2*e,0,1)},100).catch(ue)),this.progress=e)},t.prototype.setOpacity=function(e){this.opacity!==e&&(this.opacity=e=Gt(e,0,1),this.opacityMotion.set({opacity:e},200).catch(ue))},t.prototype.setCurrent=function(e){this.current!==e&&(this.currentMotion.set({progress:e?1:0},2e3).catch(ue),this.current=e,!0===this.current&&(this.currentStartTime=de()))},t.prototype.setLoading=function(e){this.loading!==e&&(this.loading=e,!0===this.disabled&&this.setDisabled(!1),this.loadingOpacityMotion.set({opacity:e?1:0},500).catch(ue))},t.prototype.setDisabled=function(e){this.disabled!==e&&(this.disabled=e,!0===this.loading&&this.setLoading(!1),this.disableMotion.set({progress:e?1:0},500).catch(ue))},t.prototype.tap=function(){var e=this;if(!this.tapMotion.ended)return Promise.resolve();return this.progressOpacityMotion.set({opacity:0},0).catch(ue),this.progressMotion.set({progress:0},0).catch(ue),this.tapMotion.setKeyframes([{progress:0,value:{scale:1,opacity:1}},{progress:.3,value:{scale:.85,opacity:.5}},{progress:.8,value:{scale:1.05,opacity:.6}},{progress:1,value:{scale:1,opacity:1}}],600).then((function(){e.progressOpacityMotion.set({opacity:e.progress>0?1:0},300).catch(ue),e.progressMotion.set({progress:e.progress},120).catch(ue)})).catch(ue)},t.prototype.updateTime=function(e,t){if(!this.progressMotion.ended){this.progressMotion.update(e);var n=this.progressMotion.value.progress;this.panoMesh.material.uniforms.progress.value=n,this.needsRender=!0}if(!this.progressOpacityMotion.ended){this.progressOpacityMotion.update(e);var i=this.progressOpacityMotion.value.opacity;this.panoMesh.material.uniforms.progressOpacity.value=i,this.needsRender=!0}if(!this.opacityMotion.ended){this.opacityMotion.update(e);i=this.opacityMotion.value.opacity;this.panoMesh.material.uniforms.opacity.value=i,this.needsRender=!0}if((!this.loadingOpacityMotion.ended||this.loadingOpacityMotion.value.opacity>0)&&(this.loadingOpacityMotion.update(e),this.panoMesh.material.uniforms.loadingOpacity.value=this.loadingOpacityMotion.value.opacity,this.panoMesh.material.uniforms.loadingAngle.value=e/120%(2*Math.PI),this.needsRender=!0),this.tapMotion.ended||(this.tapMotion.update(e),this.panoMesh.material.uniforms.tapOpacity.value=this.tapMotion.value.opacity,this.panoMesh.material.uniforms.tapScale.value=this.tapMotion.value.scale,this.needsRender=!0),this.panoMesh.material.uniforms.circleOpacity.value=Math.max(.6,1-Math.max(this.loadingOpacityMotion.value.opacity,this.progressOpacityMotion.value.opacity)),this.current||!this.currentMotion.ended){this.currentMotion.update(e),this.panoMesh.material.uniforms.expandOpacity.value=this.currentMotion.value.progress;var r=(e-this.currentStartTime-1500)/2e3;if(r%5<2){var o=r%1;this.panoMesh.material.uniforms.expand0.value=Er(o)*this.currentMotion.value.progress,this.needsRender=!0}var a=(e-this.currentStartTime-1e3)/2e3;if(a%5<2){o=a%1;this.panoMesh.material.uniforms.expand1.value=Er(o)*this.currentMotion.value.progress,this.needsRender=!0}}if(!this.disableMotion.ended){n=this.disableMotion.value.progress;this.disableMotion.update(e),this.panoMesh.material.uniforms.disable.value=n,this.needsRender=!0}},t.prototype.dispose=function(){this.tapMotion.dispose(),this.progressMotion.dispose(),this.progressOpacityMotion.dispose(),this.opacityMotion.dispose(),this.currentMotion.dispose(),this.panoMesh.material.dispose()},t}(i.Object3D),Br=new i.CircleBufferGeometry(.1,16),Tr=new i.ShaderMaterial({vertexShader:"\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",fragmentShader:"\nvarying vec2 vUv;\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 * outside * inside);\n}\n",transparent:!0}),Pr=function(e){function t(){var t=e.call(this)||this;return t.ringMesh=new i.Mesh(Br,Tr),t.ringMesh.renderOrder=-2,t.add(t.ringMesh),t}return ie(t,e),t.prototype.dispose=function(){this.remove(this.ringMesh)},t}(i.Object3D);function Rr(e,t,n){var i=Math.abs(e-t);return i<.001||void 0!==n&&Math.abs(n-i)<.001}function Lr(e,t,n){return!Rr(e,t,n)}function Or(e,t){return e.distanceTo(t)<.001}function Fr(e,t){return!Or(e,t)}var kr=new i.Vector3(0,0,0),Dr=function(e){function t(t,n){void 0===n&&(n=kr);var r=e.call(this)||this,o=new i.BoxBufferGeometry(t.max.x-t.min.x+2*n.x,t.max.y-t.min.y+2*n.y,t.max.z-t.min.z+2*n.z,1,1);o.groups.length=0,o.groups.push({start:0,count:36,materialIndex:0}),o.applyMatrix4((new i.Matrix4).makeScale(-1,1,1)),o.computeVertexNormals();var a=new Bt;a.defines.USE_MAP=!1,a.defines.USE_UV=!1,a.defines.USE_PANO_OPACITY=!0,a.uniforms.diffuse.value=new i.Color(10066329),a.depthWrite=!1;var s=new je(o,[a]);return s.floorIndex=-1,s.position.copy(t.getCenter(new i.Vector3)),s.frustumCulled=!1,r.renderOrder=-4,r.add(s),r.boundingBox=new i.Box3,r.boundingBox.setFromObject(r),r}return ie(t,e),t.prototype.dispose=function(){this.disposeMaterial(),this.disposeGeometry()},t}(Ge);function Qr(e,t){return void 0===t&&(t=kr),new Dr(e,t)}var Nr=2*Math.PI;function Vr(e){return e>=0&&e<Nr?e:(e%Nr+Nr)%Nr}var Ur=Math.PI,zr=2*Ur;function qr(e,t,n){if(e===t)return t;var i=t-e;return Math.abs(i)<=n?t:e+(i>0?1:-1)*n}function Hr(e,t,n){if(e.longitude===t.longitude&&e.latitude===t.latitude)return{longitude:t.longitude,latitude:t.latitude};var i=Vr(e.longitude),r=e.latitude,o=Vr(t.longitude),a=t.latitude;o-i>Ur?i+=zr:i-o>Ur&&(i-=zr);var s=n/Math.sqrt(Math.pow(o-i,2)+Math.pow(a-r,2));return s>=1?{longitude:t.longitude,latitude:t.latitude}:{longitude:i+(o-i)*s,latitude:r+(a-r)*s}}!function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}();var _r=function(){var e="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"node";return/android/i.test(e)||/webos/i.test(e)||/ipad|iphone|ipod/i.test(e)||/iemobile/i.test(e)||/opera mini/i.test(e)||/blackberry/i.test(e)||/windows phone/i.test(e)};function jr(e,t){e.mode=t.mode,e.panoIndex=t.panoIndex,e.longitude=t.longitude,e.latitude=t.latitude,e.fov=t.fov,e.offset.copy(t.offset),e.distance=t.distance}function Kr(e,t){return e.panoIndex===t.panoIndex&&e.mode===t.mode&&Rr(e.longitude,t.longitude,2*Math.PI)&&Rr(e.latitude,t.latitude)&&Rr(e.fov,t.fov)&&Or(e.offset,t.offset)&&Rr(e.distance,t.distance)}var Gr=function(e){return Number(e)};function Wr(e,t,n){var i;void 0===t&&(t=Gr),void 0===n&&(n=!1);for(var r,o=1/0,a=0,s=e;a<s.length;a++){var l=s[a],c=t(l);c<=o&&(r=(i=[l,c])[0],o=i[1])}return isFinite(o)||(o=0),n?[r,o]:r}function Xr(e){for(var t in e)return!1;return!0}function Yr(e){return{longitude:e.longitude,latitude:e.latitude,fov:e.fov,offset:e.offset.clone(),distance:e.distance}}
358
+ /*! Hammer.JS - v2.0.7 - 2016-04-22
359
+ * http://hammerjs.github.io/
360
+ *
361
+ * Copyright (c) 2016 Jorik Tangelder;
362
+ * Licensed under the MIT license */var Zr=function(e,t,n,i){var r,o=["","webkit","Moz","MS","ms","o"],a=t.createElement?t.createElement("div"):i,s="function",l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(g(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function f(t,n,i){var r="DEPRECATED METHOD: "+n+"\n"+i+" AT \n";return function(){var n=new Error("get-stack-trace"),i=n&&n.stack?n.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,i),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var A=f((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),v=f((function(e,t){return A(e,t,!0)}),"merge","Use `assign`.");function m(e,t,n){var i,o=t.prototype;(i=e.prototype=Object.create(o)).constructor=e,i._super=o,n&&r(i,n)}function g(e,t){return function(){return e.apply(t,arguments)}}function y(e,t){return typeof e==s?e.apply(t&&t[0]||i,t):e}function b(e,t){return e===i?t:e}function x(e,t,n){p(E(t),(function(t){e.addEventListener(t,n,!1)}))}function w(e,t,n){p(E(t),(function(t){e.removeEventListener(t,n,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function C(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function I(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}function S(e){return Array.prototype.slice.call(e,0)}function B(e,t,n){for(var i=[],r=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];I(r,a)<0&&i.push(e[o]),r[o]=a,o++}return n&&(i=t?i.sort((function(e,n){return e[t]>n[t]})):i.sort()),i}function T(e,t){for(var n,r,a=t[0].toUpperCase()+t.slice(1),s=0;s<o.length;){if((r=(n=o[s])?n+a:t)in e)return r;s++}return i}var P=1;function R(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}var L="ontouchstart"in e,O=T(e,"PointerEvent")!==i,F=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),k="touch",D="mouse",Q=25,N=1,V=2,U=4,z=8,q=1,H=2,_=4,j=8,K=16,G=H|_,W=j|K,X=G|W,Y=["x","y"],Z=["clientX","clientY"];function J(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){y(e.options.enable,[e])&&n.handler(t)},this.init()}function $(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=t&N&&r-o==0,s=t&(U|z)&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,h=t.center=te(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=oe(l,h),t.distance=re(l,h),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==N&&o.eventType!==U||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=ie(t.deltaX,t.deltaY);var d=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=s?function(e,t){return re(t[0],t[1],Z)/re(e[0],e[1],Z)}(s.pointers,r):1,t.rotation=s?function(e,t){return oe(t[1],t[0],Z)+oe(e[1],e[0],Z)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(t.eventType!=z&&(l>Q||s.velocity===i)){var u=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=ne(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,a=ie(u,h),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var p=e.element;M(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:l(n/t),y:l(i/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function ie(e,t){return e===t?q:c(e)>=c(t)?e<0?H:_:t<0?j:K}function re(e,t,n){n||(n=Y);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function oe(e,t,n){n||(n=Y);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}J.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(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(R(this.element),this.evWin,this.domHandler)}};var ae={mousedown:N,mousemove:V,mouseup:U},se="mousedown",le="mousemove mouseup";function ce(){this.evEl=se,this.evWin=le,this.pressed=!1,J.apply(this,arguments)}m(ce,J,{handler:function(e){var t=ae[e.type];t&N&&(0===e.button||2===e.button)&&(this.pressed=!0),t&V&&1!==e.which&&(t=U),this.pressed&&(t&U&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:D,srcEvent:e}))}});var ue={pointerdown:N,pointermove:V,pointerup:U,pointercancel:z,pointerout:z},he={2:k,3:"pen",4:D,5:"kinect"},de="pointerdown",pe="pointermove pointerup pointercancel";function fe(){this.evEl=de,this.evWin=pe,J.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(de="MSPointerDown",pe="MSPointerMove MSPointerUp MSPointerCancel"),m(fe,J,{handler:function(e){var t=this.store,n=!1,i=!1,r=e.type.toLowerCase().replace("ms",""),o=ue[r],a=he[e.pointerType]||e.pointerType,s=a==k,l=I(t,e.pointerId,"pointerId");o&N&&(0===e.button||2===e.button||s)?l<0&&(t.push(e),l=t.length-1):o&(U|z)?n=!0:s||0!==e.buttons||(n=!0,i=!0,o=ue.pointerup),l<0||(i||(t[l]=e),this.callback(this.manager,o,{pointers:t,changedPointers:[e],pointerType:a,srcEvent:t[l]}),n&&t.splice(l,1))}});var Ae={touchstart:N,touchmove:V,touchend:U,touchcancel:z};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,J.apply(this,arguments)}function me(e,t){var n=S(e.touches),i=S(e.changedTouches);return t&(U|z)&&(n=B(n.concat(i),"identifier",!0)),[n,i]}m(ve,J,{handler:function(e){var t=Ae[e.type];if(t===N&&(this.started=!0),this.started){var n=me.call(this,e,t);t&(U|z)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:k,srcEvent:e})}}});var ge={touchstart:N,touchmove:V,touchend:U,touchcancel:z},ye="touchstart touchmove touchend touchcancel";function be(){this.evTarget=ye,this.targetIds={},J.apply(this,arguments)}function xe(e,t){var n=S(e.touches),i=this.targetIds;if(t&(N|V)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,a=S(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return M(e.target,l)})),t===N)for(r=0;r<o.length;)i[o[r].identifier]=!0,r++;for(r=0;r<a.length;)i[a[r].identifier]&&s.push(a[r]),t&(U|z)&&delete i[a[r].identifier],r++;return s.length?[B(o.concat(s),"identifier",!0),s]:void 0}m(be,J,{handler:function(e){var t=ge[e.type],n=xe.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:k,srcEvent:e})}});var we=2500;function Me(){J.apply(this,arguments);var e=g(this.handler,this);this.touch=new be(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function Ce(e,t){e&N?(this.primaryTouch=t.changedPointers[0].identifier,Ee.call(this,t)):e&(U|z)&&Ee.call(this,t)}function Ee(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches;setTimeout((function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)}),we)}}function Ie(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),a=Math.abs(n-r.y);if(o<=25&&a<=25)return!0}return!1}m(Me,J,{handler:function(e,t,n){var i=n.pointerType==k,r=n.pointerType==D;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)Ce.call(this,t,n);else if(r&&Ie.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Se=a?T(a.style,"touchAction"):i,Be=Se!==i,Te="compute",Pe="auto",Re="manipulation",Le="none",Oe="pan-x",Fe="pan-y",ke=function(){if(!Be)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){t[i]=!n||e.CSS.supports("touch-action",i)})),t}();function De(e,t){this.manager=e,this.set(t)}De.prototype={set:function(e){e==Te&&(e=this.compute()),Be&&this.manager.element.style&&ke[e]&&(this.manager.element.style[Se]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){y(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(C(e,Le))return Le;var t=C(e,Oe),n=C(e,Fe);if(t&&n)return Le;if(t||n)return t?Oe:Fe;if(C(e,Re))return Re;return Pe}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=C(i,Le)&&!ke[Le],o=C(i,Fe)&&!ke[Fe],a=C(i,Oe)&&!ke[Oe];if(r){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return r||o&&n&G||a&&n&W?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Qe=1,Ne=2,Ve=4,Ue=8,ze=Ue,qe=16,He=32;function _e(e){this.options=r({},this.defaults,e||{}),this.id=P++,this.manager=null,this.options.enable=b(this.options.enable,!0),this.state=Qe,this.simultaneous={},this.requireFail=[]}function je(e){return e&qe?"cancel":e&Ue?"end":e&Ve?"move":e&Ne?"start":""}function Ke(e){return e==K?"down":e==j?"up":e==H?"left":e==_?"right":""}function Ge(e,t){var n=t.manager;return n?n.get(e):e}function We(){_e.apply(this,arguments)}function Xe(){We.apply(this,arguments),this.pX=null,this.pY=null}function Ye(){We.apply(this,arguments)}function Ze(){_e.apply(this,arguments),this._timer=null,this._input=null}function Je(){We.apply(this,arguments)}function $e(){We.apply(this,arguments)}function et(){_e.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function tt(e,t){return(t=t||{}).recognizers=b(t.recognizers,tt.defaults.preset),new nt(e,t)}_e.prototype={defaults:{},set:function(e){return r(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ge(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ge(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===I(t,e=Ge(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ge(e,this);var t=I(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,n=this.state;function i(n){t.manager.emit(n,e)}n<Ue&&i(t.options.event+je(n)),i(t.options.event),e.additionalEvent&&i(e.additionalEvent),n>=Ue&&i(t.options.event+je(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=He},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(He|Qe)))return!1;e++}return!0},recognize:function(e){var t=r({},e);if(!y(this.options.enable,[this,t]))return this.reset(),void(this.state=He);this.state&(ze|qe|He)&&(this.state=Qe),this.state=this.process(t),this.state&(Ne|Ve|Ue|qe)&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},m(We,_e,{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,n=e.eventType,i=t&(Ne|Ve),r=this.attrTest(e);return i&&(n&z||!r)?t|qe:i||r?n&U?t|Ue:t&Ne?t|Ve:Ne:He}}),m(Xe,We,{defaults:{event:"pan",threshold:10,pointers:1,direction:X},getTouchAction:function(){var e=this.options.direction,t=[];return e&G&&t.push(Fe),e&W&&t.push(Oe),t},directionTest:function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(t.direction&G?(r=0===o?q:o<0?H:_,n=o!=this.pX,i=Math.abs(e.deltaX)):(r=0===a?q:a<0?j:K,n=a!=this.pY,i=Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},attrTest:function(e){return We.prototype.attrTest.call(this,e)&&(this.state&Ne||!(this.state&Ne)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Ye,We,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ne)},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)}}),m(Ze,_e,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Pe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!i||!n||e.eventType&(U|z)&&!r)this.reset();else if(e.eventType&N)this.reset(),this._timer=h((function(){this.state=ze,this.tryEmit()}),t.time,this);else if(e.eventType&U)return ze;return He},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===ze&&(e&&e.eventType&U?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),m(Je,We,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Le]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ne)}}),m($e,We,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|W,pointers:1},getTouchAction:function(){return Xe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(G|W)?t=e.overallVelocity:n&G?t=e.overallVelocityX:n&W&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&e.eventType&U},emit:function(e){var t=Ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(et,_e,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Re]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),e.eventType&N&&0===this.count)return this.failTimeout();if(i&&r&&n){if(e.eventType!=U)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||re(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=h((function(){this.state=ze,this.tryEmit()}),t.interval,this),Ne):ze}return He},failTimeout:function(){return this._timer=h((function(){this.state=He}),this.options.interval,this),He},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ze&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),tt.VERSION="2.0.7",tt.defaults={domEvents:!1,touchAction:Te,enable:!0,inputTarget:null,inputClass:null,preset:[[Je,{enable:!1}],[Ye,{enable:!1},["rotate"]],[$e,{direction:G}],[Xe,{direction:G},["swipe"]],[et],[et,{event:"doubletap",taps:2},["tap"]],[Ze]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function nt(e,t){var n;this.options=r({},tt.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?fe:F?be:L?Me:ce))(n,$),this.touchAction=new De(this,this.options.touchAction),it(this,!0),p(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 it(e,t){var n,i=e.element;i.style&&(p(e.options.cssProps,(function(r,o){n=T(i.style,o),t?(e.oldCssProps[n]=i.style[n],i.style[n]=r):i.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}return nt.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 n;this.touchAction.preventDefaults(e);var i=this.recognizers,r=t.curRecognizer;(!r||r&&r.state&ze)&&(r=t.curRecognizer=null);for(var o=0;o<i.length;)n=i[o],2===t.stopped||r&&n!=r&&!n.canRecognizeWith(r)?n.reset():n.recognize(e),!r&&n.state&(Ne|Ve|Ue)&&(r=t.curRecognizer=n),o++}},get:function(e){if(e instanceof _e)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(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(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=I(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return p(E(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(E(e),(function(e){t?n[e]&&n[e].splice(I(n[e],t),1):delete n[e]})),this}},emit:function(e,n){this.options.domEvents&&function(e,n){var i=t.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=n,n.target.dispatchEvent(i)}(e,n);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){n.type=e,n.preventDefault=function(){n.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](n),r++}},destroy:function(){this.element&&it(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(tt,{INPUT_START:N,INPUT_MOVE:V,INPUT_END:U,INPUT_CANCEL:z,STATE_POSSIBLE:Qe,STATE_BEGAN:Ne,STATE_CHANGED:Ve,STATE_ENDED:Ue,STATE_RECOGNIZED:ze,STATE_CANCELLED:qe,STATE_FAILED:He,DIRECTION_NONE:q,DIRECTION_LEFT:H,DIRECTION_RIGHT:_,DIRECTION_UP:j,DIRECTION_DOWN:K,DIRECTION_HORIZONTAL:G,DIRECTION_VERTICAL:W,DIRECTION_ALL:X,Manager:nt,Input:J,TouchAction:De,TouchInput:be,MouseInput:ce,PointerEventInput:fe,TouchMouseInput:Me,SingleTouchInput:ve,Recognizer:_e,AttrRecognizer:We,Tap:et,Pan:Xe,Swipe:$e,Pinch:Ye,Rotate:Je,Press:Ze,on:x,off:w,each:p,merge:v,extend:A,assign:r,inherit:m,bindFn:g,prefixed:T}),tt}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{});function Jr(e,t,n){var r=t.getBoundingClientRect(),o=r.top,a=r.left,s=r.width,l=r.height;return n&&(a+=s*n.left,o+=l*(1-n.bottom-n.height),s*=n.width,l*=n.height),new i.Vector2((e.x-a)/s*2-1,-(e.y-o)/l*2+1)}var $r=new i.OrthographicCamera(-1,1,1,-1,0,1),eo=new i.BufferGeometry;eo.setAttribute("position",new i.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),eo.setAttribute("uv",new i.Float32BufferAttribute([0,2,0,0,2,0],2));var to=new i.Mesh(eo),no=new i.Scene;no.add(to);var io=function(){function e(e,t){var n;this.renderer=e,this.material=new i.ShaderMaterial({vertexShader:null!==(n=t.vertex)&&void 0!==n?n:"\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 i.Uniform(null)},t.uniforms),defines:Object.assign({},t.defines),blending:i.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var n=this.renderer.getRenderTarget(),i=to.material;this.material.uniforms.inputBuffer.value=e.texture,to.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(no,$r),this.renderer.setRenderTarget(n),to.material=i},e.prototype.dispose=function(){this.material.dispose()},e}(),ro=function(){function e(e){this.renderer=e,this.material=new i.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 i.Uniform(new i.Vector3)}),blending:i.NoBlending,depthWrite:!1,depthTest:!1})}return e.prototype.render=function(e,t){var n=this.renderer.getRenderTarget(),i=to.material;this.material.uniforms.inputValue.value.copy(e),to.material=this.material,this.renderer.setRenderTarget(t||null),this.renderer.render(no,$r),this.renderer.setRenderTarget(n),to.material=i},e.prototype.dispose=function(){this.material.dispose()},e}(),oo=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 ie(t,e),t}(io),ao=function(){function e(e){this.enable=!0,this.renderer=e,this.copyPass=new oo(this.renderer)}return e.prototype.render=function(e,t){this.copyPass.render(e,t)},e.prototype.dispose=function(){this.copyPass.dispose()},e}(),so=function(e){function t(n){var i,r=this;r=e.call(this)||this;var o=t.parseArgs(n);return r.pending=new Set,r.userAction=o.initial[3],r.destroyed=!1,r.ident=o.ident,r.scene=o.scene,r.xrCustomObjectsScene=o.xrCustomObjectsScene,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!==(i=o.enableIOSEDR)&&void 0!==i&&i,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 gr({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)})),r.pending.add("init-animation"),Fe.shared.add((function(){r.initAnimation.apply(r,o.initial).then((function(){r.pending.delete("init-animation")}))}),!0),r}return ie(t,e),t.parseArgs=function(e){return re({},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,n=this.eventUnbinds;t<n.length;t++){(0,n[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 0===this.pending.size&&!0===this.cameraMotion.ended},t.prototype.bindExtraElement=function(e){for(var t=0,n=this.eventUnbinds;t<n.length;t++){if(n[t].element===e)return}this.eventUnbinds.push(this.bindEvents(e))},t.prototype.unbindExtraElement=function(e){for(var t=[],n=0,i=this.eventUnbinds;n<i.length;n++){var r=i[n];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,n,i,r){return this.work=e,this.userAction=r,!1},t.prototype.updateTime=function(e,t){if(!this.destroyed){var n={};this.cameraMotion.ended&&(this.cameraMotion.update(e),n.longitude=this.cameraMotion.value.longitude,n.latitude=this.cameraMotion.value.latitude,n.fov=this.cameraMotion.value.fov),Xr(n)&&this.setCamera(n)}},t.prototype.render=function(){this.renderer.render(this.scene,this.camera)},t.prototype.postProcessing=function(e,t){this.destroyed||(this.copyEffect||(this.copyEffect=new ao(this.renderer)),this.copyEffect.render(e,t))},t.prototype.updateCamera=function(e,t,n){return this.userAction=n,this.cameraMotion.set(e,t).catch(ue)},t.prototype.updateCameraWithKeyframes=function(e,t,n){return this.userAction=n,this.cameraMotion.setKeyframes(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[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,n){void 0===t&&(t={}),this.userAction=n;var i={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,i),this.emit("moveToPano",e,this.userAction),this.emit("panoWillArrive",e,i,this.userAction),this.emit("panoArrived",e,i,this.userAction),t.moveEndCallback&&t.moveEndCallback(e,i)},t.prototype.initAnimation=function(e,t,n,i){return this.userAction=i,Promise.resolve()},t.prototype.setCamera=function(e){var t,n,i,r,o;void 0===e&&(e={});var a=null!==(t=e.longitude)&&void 0!==t?t:this.camera.pose.longitude,s=null!==(n=e.latitude)&&void 0!==n?n:this.camera.pose.latitude,l=null!==(i=e.fov)&&void 0!==i?i:this.camera.pose.fov,c=null!==(r=e.distance)&&void 0!==r?r:this.camera.pose.distance,u=null!==(o=e.offset)&&void 0!==o?o:this.camera.pose.offset,h=this.camera.position.clone(),d=Lr(a,this.camera.pose.longitude,2*Math.PI)||Lr(s,this.camera.pose.latitude),p=Lr(l,this.camera.pose.fov),f=Lr(c,this.camera.pose.distance),A=Fr(u,this.camera.pose.offset);this.camera.setFromPose({longitude:a,latitude:s,fov:l,distance:c,offset:u});var v=Fr(h,this.camera.position);p&&this.emit("cameraFovUpdate",l,this.userAction),d&&this.emit("cameraDirectionUpdate",{longitude:a,latitude:s},this.userAction),v&&this.emit("cameraPositionUpdate",this.camera.position.clone(),this.userAction),(p||d||A||f)&&this.emit("cameraUpdate",{longitude:a,latitude:s,fov:l,offset:u,distance:c},this.userAction),this.needsRender=!0},t.prototype.onPanGesture=function(e){var t=this.panState,n=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={mouseState:void 0,pointerLength:n,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===n){var i=e.pointers.map((function(e){return un(e,["x","y"])}));this.emit("wantsGesture","pan",i,e.isFinal)||this.emit("gesture","pan",i,e.isFinal)}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return un(e,["x","y"])}));this.emit("wantsGesture","tap",t,!0)||this.emit("gesture","tap",t,!0)},t.prototype.onPressGesture=function(e,t){var n,i=[e];if(this.emit("wantsGesture","press",i,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;this.emit("gesture","press",i,t)},t.prototype.onPinchGesture=function(e){var t=e.pointers.map((function(e){return un(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,n=[{x:e.clientX,y:e.clientY,delta:t}];this.emit("wantsGesture","mouseWheel",n,!1)||this.emit("gesture","mouseWheel",n,!1)},t.prototype.onMouseMove=function(e){},t.prototype.onMouseOut=function(){},t.prototype.relativeClientPosition=function(e){return Jr(e,this.element,this.scissor)},t.prototype.bindEvents=function(e){var t=this,n=function(e){var n=Jr(e,t.element,t.scissor);return!(Math.abs(n.x)>1||Math.abs(n.y)>1)},i=new Zr.Manager(e),r=function(e){return e.session.firstInput||null};i.add(new Zr.Pan({threshold:10,pointers:0})),i.add(new Zr.Tap({interval:410})),i.add(new Zr.Pinch({threshold:0,pointers:2})),i.on("panstart pan",(function(e){var o=r(i);o&&!n(o.center)||(t.onPanGesture(e),f())})),i.on("tap",(function(e){if("mouse"!==e.pointerType||0===e.srcEvent.button){var o=r(i);o&&!n(o.center)||(t.onTapGesture(e),f())}})),i.on("pinchstart pinch pinchend",(function(e){var o=r(i);o&&!n(o.center)||(t.onPinchGesture(e),f())}));var o=null,a=null,s=function(e,t,n){var i="pinchend"===e?t:t-n.deltaY/280;return{type:e,target:n.target,pointerType:"mouse",srcEvent:n,pointers:[{x:n.clientX,y:n.clientY}],isFirst:"pinchstart"===e,isFinal:"pinchend"===e,scale:Gt(i,.1,10),center:{x:n.clientX,y:n.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},l=function(e){var i,r={x:e.clientX,y:e.clientY};if(n(r)){if(e.preventDefault(),e.ctrlKey){var l=null!==(i=null==o?void 0:o.prevInput.scale)&&void 0!==i?i:1,c=s(o?"pinch":"pinchstart",l,e);null===o?o={firstInput:c,prevInput:c}:o.prevInput=c,t.onPinchGesture(c),null!==a&&window.clearTimeout(a),a=window.setTimeout((function(){var n;a=null;var i=null!==(n=null==o?void 0:o.prevInput.scale)&&void 0!==n?n:1,r=s("pinchend",i,e);o=null,t.onPinchGesture(r)}),200)}else t.onMouseWheel(e);f()}},c=function(e){if(!_r()){var i={x:e.clientX,y:e.clientY};n(i)?(t.onMouseMove(e),t.pressState&&Math.abs(e.clientX-t.pressState.x)>10&&Math.abs(e.clientY-t.pressState.y)>10&&f()):t.onMouseOut()}},u=function(){t.onMouseOut(),f()},h=function(e,i){if(n(e)){t.pressState={x:e.x,y:e.y,time:t.pressState?t.pressState.time:i,stop:ue};var r=i-t.pressState.time;t.onPressGesture({x:e.x,y:e.y,delta:r},!1),t.pressState&&(t.pressState.stop=Fe.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},de())},p=function(e){f(),h({x:e.clientX,y:e.clientY},de())},f=function(){var e;if(t.pressState){var n=de()-t.pressState.time;t.onPressGesture({x:t.pressState.x,y:t.pressState.y,delta:n},!0),null===(e=t.pressState)||void 0===e||e.stop(),delete t.pressState}},A=null,v=function(e){var t,n="pinch",i=!1,r=!1;switch(e.type){case"gesturestart":n="pinchstart",i=!0;break;case"gestureend":n="pinchend",r=!0}return{type:n,target:e.target,pointerType:"mouse",srcEvent:e,pointers:[{x:e.clientX,y:e.clientY}],isFirst:i,isFinal:r,scale:null!==(t=e.scale)&&void 0!==t?t:1,center:{x:e.clientX,y:e.clientY},velocityX:0,velocityY:0,overallVelocityX:0,overallVelocityY:0}},m=function(e){if(e.preventDefault(),!_r()){var i=v(e),r=(A={firstInput:i}).firstInput;r&&!n(r.center)||t.onPinchGesture(i)}},g=function(e){if(e.preventDefault(),!_r()&&A){var i=v(e),r=A.firstInput;r&&!n(r.center)||t.onPinchGesture(i)}},y=function(e){if(e.preventDefault(),!_r()&&A){var i=v(e),r=A.firstInput;A=null,r&&!n(r.center)||t.onPinchGesture(i)}},b=function(t){if(t&&"function"==typeof t.preventDefault&&t.currentTarget===e&&t.preventDefault(),"function"==typeof getSelection){var n=getSelection();n&&n.focusNode&&(n.removeAllRanges&&n.removeAllRanges(),n.empty&&n.empty())}};e.addEventListener("wheel",l,{passive:!1}),e.addEventListener("mousemove",c,!1),e.addEventListener("mouseout",u,!1),e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchend",f,!1),e.addEventListener("touchcancel",f,!1),e.addEventListener("mousedown",p,!1),e.addEventListener("mouseup",f,!1),e.addEventListener("gesturestart",m,{passive:!1}),e.addEventListener("gesturechange",g,{passive:!1}),e.addEventListener("gestureend",y,{passive:!1}),e.addEventListener("touchstart",b,{passive:!1}),e.addEventListener("contextmenu",b,!1);return Object.assign((function(){i.destroy(),e.removeEventListener("wheel",l,!1),e.removeEventListener("mousemove",c,!1),e.removeEventListener("mouseout",u,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchend",f,!1),e.removeEventListener("touchcancel",f,!1),e.removeEventListener("mousedown",p,!1),e.removeEventListener("mouseup",f,!1),e.removeEventListener("gesturestart",m,!1),e.removeEventListener("gesturechange",g,!1),e.removeEventListener("gestureend",y,!1),e.removeEventListener("touchstart",b,!1),e.removeEventListener("contextmenu",b,!1)}),{element:e})},t}(ce),lo=function(e){function t(n){var i,r,o=this,a=t.parseArgs(n);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 gr({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===(i=o.model.getMaterial())||void 0===i?void 0:i.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 ie(t,e),t.distanceFromModel=function(e,t,n){var i=e.bounding,r=Math.pow(Math.pow(i.max.x-i.min.x+1,2)+Math.pow(i.max.y-i.min.y+1,2)+Math.pow(i.max.z-i.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return n<1&&(o/=n),isNaN(o)?r:o},t.parseArgs=function(t){var n,i,r,o,a,s,l,c,u=e.parseArgs.call(this,t);return re(re({},u),{defaultLongitude:null!==(n=t.defaultLongitude)&&void 0!==n?n:Math.PI/4,defaultLatitude:null!==(i=t.defaultLatitude)&&void 0!==i?i:Math.PI/4,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:80,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,intersectMeshCreator:null!==(c=t.intersectMeshCreator)&&void 0!==c?c:function(){return new Pr}})},t.initAnimationEndPose=function(e){var n,r,o,a=this.parseArgs(e),s=e.initial[1];return{longitude:null!==(n=s.longitude)&&void 0!==n?n:a.defaultLongitude,latitude:Gt(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 i.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,n,i,r){return this.work=e,this.updateCamera(n,null!=i?i:0,r),!0},t.prototype.updateModel=function(n){e.prototype.updateModel.call(this,n);var r=n.bounding.getCenter(new i.Vector3),o=t.distanceFromModel(n,this.defaultFov,this.camera.aspect);this.locationMotion.set({x:r.x,y:r.y,z:r.z,distance:o},0).catch(ue)},t.prototype.updateTime=function(e,t){if(!this.destroyed){var n={},r={};this.locationMotion.ended||(this.locationMotion.update(e),n.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new i.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),Xr(n)||this.model.setMaterial(n),Xr(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[1],t=this.locationMotion.getKeyFrameSegment(de())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new i.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.initAnimation=function(e,n,r,o){var a=this;return this.destroyed?Promise.resolve():new Promise((function(s){var l,c,u;a.userAction=o;var h={longitude:null!==(l=n.longitude)&&void 0!==l?l:a.defaultLongitude,latitude:Gt(null!==(c=n.latitude)&&void 0!==c?c:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:Gt(null!==(u=n.fov)&&void 0!==u?u:a.defaultFov,a.minFov,a.maxFov),offset:a.model.bounding.getCenter(new i.Vector3),distance:t.distanceFromModel(a.model,a.defaultFov,a.camera.aspect)},d=un(h,["longitude","latitude","fov"]),p={x:h.offset.x,y:h.offset.y,z:h.offset.z,distance:h.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:h.distance};a.emit("initAnimationWillStart",e,h,a.userAction),a.cameraMotion.set(d,r).catch(ue),a.locationMotion.set(p,r).then((function(){a.emit("initAnimationEnded",e,h,a.userAction)}),(function(t){var n=Yr(a.camera.pose);a.emit("initAnimationEnded",e,n,a.userAction)})).then((function(){s()}))}))},t.prototype.updateRenderSize=function(){this.locationMotion.set({distance:t.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(ue)},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),n=this.model.intersectRaycaster(e)[0];if(!n)return null;var i=Wr(t,(function(e){return e.standingPosition.distanceTo(n.point)}),!0),r=i[0];return i[1]<10?r.panoIndex:null},t.prototype.coordinatesForOffset=function(e){var t=this.renderer.getSize(new i.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 n=this;if(!1!==this.interiaMovement){for(var i=re({},e),r={longitude:0,latitude:0},o=0;o<t;o++)i.longitude*=.996,i.latitude*=.994008,r.longitude+=i.longitude,r.latitude+=i.latitude;var a=Vr(this.cameraMotion.value.longitude+r.longitude),s=Gt(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(ue);var c=i.longitude>1e-4||i.longitude<-1e-4||i.latitude>1e-4||i.latitude<-1e-4;this.emit("interiaPan",l,!c),c?Fe.shared.add((function(e,t){n.requestInteriaMovement(i,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,n=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={mouseState:void 0,pointerLength:n,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===n){var i=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pan",i,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=Vr(this.cameraMotion.value.longitude+s.longitude),c=Gt(this.cameraMotion.value.latitude+s.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(c=this.cameraMotion.value.latitude);var u={longitude:l,latitude:c,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance};if(!this.emit("wantsPanGesture",u,e.isFinal))if(this.emit("gesture","pan",i,e.isFinal),this.emit("panGesture",u,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh(),this.cameraMotion.set({longitude:u.longitude,latitude:u.latitude},0).catch(ue),e.isFinal)if(!this.emit("wantsInteriaPan",u)){this.interiaMovement=!0;var h=e.velocityX*a,d=e.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:h,y:d}),0)}}}},t.prototype.onPinchGesture=function(e){var t,n=null===(t=this.pinchState)||void 0===t?void 0:t.fov,i=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(i=!0,delete this.panState,delete this.pinchState),void 0!==n){var r=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,i)){var o=Gt(n/e.scale,this.minFov,this.maxFov);this.emit("wantsPinchGesture",e.scale,o,i)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,i),this.emit("pinchGesture",e.scale,o,i),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:o},0).catch(ue),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}),n=new i.Raycaster;if(n.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",n))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(n)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onMouseWheel=function(e){var t=this,n=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:n}];if(!this.emit("wantsGesture","mouseWheel",i,!1)){var r=this.minFov,o=this.maxFov,a=Gt(this.camera.fov-n,r,o);this.emit("wantsMouseWheel",n,a,!1)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","mouseWheel",i,!1),this.emit("mouseWheel",n,a,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(ue),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",i,!0)||t.emit("wantsMouseWheel",n,a,!0)||(t.emit("gesture","mouseWheel",i,!0),t.emit("mouseWheel",0,a,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=this,n=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var r=this.relativeClientPosition(e.center),o=new i.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.getForwardPanoIndexOrNot(o);if(!Ki(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 n,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new i.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 n=this;void 0===t&&(t=ue);var i=this.work.observers[e],r=this.work.allowHosts;return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=re({key:"pano.".concat(e,".").concat(t)},un(n.imageOptions,["size","format","quality","mappings"])),a=i.images[t];return Pe(n.imageOptions.transform?n.imageOptions.transform(a,o):Ue(a,o),{allowHosts:r,requestProxy:n.requestProxy,networkSubscribe:n.networkSubscribe})}))).then((function(){return t(e),e}))},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.emit("intersectionHidden"),this.needsRender=!0},t}(so),co={longitude:0,latitude:Math.PI/2},uo={longitude:0,latitude:0},ho={longitude:Math.PI/2,latitude:0},po={longitude:Math.PI,latitude:0},fo={longitude:1.5*Math.PI,latitude:0};var Ao,vo=function(e){function t(n){var i=t.parseArgs(n);return e.call(this,i)||this}return ie(t,e),t.parseArgs=function(t){var n=[t.initial[0],re(re({},t.initial[1]),{longitude:0,latitude:Math.PI/2}),t.initial[2],t.initial[3]],i=re(re({},t),{initial:n,maxLatitude:Math.PI/2,minLatitude:Math.PI/2,defaultLongitude:0,defaultLatitude:Math.PI/2});return e.parseArgs.call(this,i)},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.updateModel=function(e){this.model=e,this.needsRender=!0;var t=e.bounding.getCenter(new i.Vector3);this.locationMotion.set({x:t.x,y:t.y,z:t.z,distance:lo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect)},0).catch(ue)},t.prototype.initAnimation=function(e,t,n,r){var o=this;return this.destroyed?Promise.resolve():new Promise((function(a){var s;o.userAction=r;var l={longitude:0,latitude:Math.PI/2,fov:Gt(null!==(s=t.fov)&&void 0!==s?s:o.defaultFov,o.minFov,o.maxFov),offset:o.model.bounding.getCenter(new i.Vector3),distance:lo.distanceFromModel(o.model,o.defaultFov,o.camera.aspect)},c=un(l,["longitude","latitude","fov"]),u={x:l.offset.x,y:l.offset.y,z:l.offset.z,distance:l.distance,modelAlpha:1,perspToOrtho:1,orthoDistance:l.distance};o.cameraMotion.set(c,n).catch(ue),o.locationMotion.set(u,n).then((function(){o.emit("initAnimationEnded",e,l,o.userAction)}),(function(t){var n=Yr(o.camera.pose);o.emit("initAnimationEnded",e,n,o.userAction)})).then((function(){a()}))}))},t.prototype.getZoomOffsetFromFov=function(e,t,n){var r=this.camera.getDirection(new i.Vector3),o=Math.tan(n/2*Math.PI/180),a=Math.tan(t.fov/2*Math.PI/180),s=(a-o)/a,l=new i.Raycaster;l.setFromCamera(e,t);var c=l.ray.direction,u=c.angleTo(r),h=lo.distanceFromModel(this.model,this.defaultFov,this.camera.aspect),d=h*Math.tan(u),p=c.clone().setLength(h*Math.cos(u)).projectOnPlane(r),f=p.length(),A=s/f*p.x*d,v=s/f*p.z*d,m=s/f*p.y*d;return new i.Vector3(A,m,v)},t.prototype.requestInteriaMovement=function(e,t){},t.prototype.onPanGesture=function(e){var t=this.panState,n=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={mouseState:void 0,pointerLength:n,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===n){var r=e.pointers.map((function(e){return un(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 i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),l=this.model.bounding,c=l.getCenter(new i.Vector3),u=(l.max.x-l.min.x)/this.defaultFov*this.cameraMotion.value.fov,h=(l.max.y-l.min.y)/this.defaultFov*this.cameraMotion.value.fov,d=(l.max.z-l.min.z)/this.defaultFov*this.cameraMotion.value.fov,p={left:new i.Vector3,up:new i.Vector3,cameraDirection:"y"};this.cameraMotion.value.longitude===co.longitude&&this.cameraMotion.value.latitude===co.latitude?(p.left.set(1,0,0),p.up.set(0,0,-1),p.cameraDirection="y"):this.cameraMotion.value.longitude===uo.longitude&&this.cameraMotion.value.latitude===uo.latitude?(p.left.set(1,0,0),p.up.set(0,1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===po.longitude&&this.cameraMotion.value.latitude===po.latitude?(p.left.set(1,0,0),p.up.set(0,-1,0),p.cameraDirection="z"):this.cameraMotion.value.longitude===fo.longitude&&this.cameraMotion.value.latitude===fo.latitude?(p.left.set(0,0,-1),p.up.set(0,-1,0),p.cameraDirection="x"):this.cameraMotion.value.longitude===ho.longitude&&this.cameraMotion.value.latitude===ho.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 i.Vector2);s.add(function(e,t){var n=(new i.Vector3).copy(t);return n.multiplyScalar(-e),n}(2*o*f/A.y,p.left)),s.add(function(e,t){var n=(new i.Vector3).copy(t);return n.multiplyScalar(e),n}(2*a*f/A.y,p.up)),s.x=Gt(s.x,c.x-u,c.x+u),s.y=Gt(s.y,c.y-h,c.y+h),s.z=Gt(s.z,c.z-d,c.z+d);var v={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:s,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",v,e.isFinal)||(this.emit("gesture","pan",r,e.isFinal),this.emit("panGesture",v,e.isFinal),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(ue))}}},t.prototype.onPinchGesture=function(e){var t,n=null===(t=this.pinchState)||void 0===t?void 0:t.fov,i=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(i=!0,delete this.pinchState),void 0!==n){var r=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",r,i)){var o=Gt(n/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===co.longitude&&this.cameraMotion.value.latitude===co.latitude?s.y=0:this.cameraMotion.value.longitude===uo.longitude&&this.cameraMotion.value.latitude===uo.latitude||this.cameraMotion.value.longitude===po.longitude&&this.cameraMotion.value.latitude===po.latitude?s.z=0:(this.cameraMotion.value.longitude===fo.longitude&&this.cameraMotion.value.latitude===fo.latitude||this.cameraMotion.value.longitude===ho.longitude&&this.cameraMotion.value.latitude===ho.latitude)&&(s.x=0);var l=this.camera.pose.offset.clone().add(s);this.emit("wantsPinchGesture",e.scale,o,i)||this.emit("wantsChangeCameraFov",o)||(this.emit("gesture","pinch",r,i),this.emit("pinchGesture",e.scale,o,i),this.userAction=!0,this.locationMotion.set({x:l.x,y:l.y,z:l.z},0).catch(ue),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:o},0).catch(ue),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,n=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:n}];if(!this.emit("wantsGesture","mouseWheel",i,!1)){var r=Gt(this.cameraMotion.value.fov-n,this.minFov,this.maxFov),o=this.relativeClientPosition({x:e.clientX,y:e.clientY}),a=this.getZoomOffsetFromFov(o,this.camera,r);this.cameraMotion.value.longitude===co.longitude&&this.cameraMotion.value.latitude===co.latitude?a.y=0:this.cameraMotion.value.longitude===uo.longitude&&this.cameraMotion.value.latitude===uo.latitude||this.cameraMotion.value.longitude===po.longitude&&this.cameraMotion.value.latitude===po.latitude?a.z=0:(this.cameraMotion.value.longitude===fo.longitude&&this.cameraMotion.value.latitude===fo.latitude||this.cameraMotion.value.longitude===ho.longitude&&this.cameraMotion.value.latitude===ho.latitude)&&(a.x=0);var s=this.camera.pose.offset.clone().add(a);this.emit("wantsMouseWheel",n,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",i,!1),this.emit("mouseWheel",n,r,!1),this.userAction=!0,this.locationMotion.set({x:s.x,y:s.y,z:s.z},0).catch(ue),this.cameraMotion.set({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:r},0).catch(ue),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",i,!0)||t.emit("wantsMouseWheel",n,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",i,!0),t.emit("mouseWheel",0,r,!0))}),200)})}},t}(lo),mo=function(e){function t(n){var i=this,r=t.parseArgs(n);return(i=e.call(this,r)||this).defaultLongitude=r.defaultLongitude,i.defaultLatitude=r.defaultLongitude,i.defaultFov=r.defaultFov,i.maxFov=r.maxFov,i.minFov=r.minFov,i.maxLatitude=r.maxLatitude,i.minLatitude=r.minLatitude,i.moveSpeed=r.moveSpeed,i.intersectMeshCreator=r.intersectMeshCreator,i.interiaMovement=!1,i.intersectMesh=i.intersectMeshCreator(),i.intersectMesh.name="intersect",i.intersectMesh.visible=!1,i.helper.add(i.intersectMesh),i}return ie(t,e),t.parseArgs=function(t){var n,i,r,o,a,s,l,c,u,h=e.parseArgs.call(this,t);return re(re({},h),{defaultLongitude:null!==(n=t.defaultLongitude)&&void 0!==n?n:0,defaultLatitude:null!==(i=t.defaultLatitude)&&void 0!==i?i:0,defaultFov:null!==(r=t.defaultFov)&&void 0!==r?r:90,maxFov:null!==(o=t.maxFov)&&void 0!==o?o:120,minFov:null!==(a=t.minFov)&&void 0!==a?a:40,maxLatitude:null!==(s=t.maxLatitude)&&void 0!==s?s:+Math.PI/2,minLatitude:null!==(l=t.minLatitude)&&void 0!==l?l:-Math.PI/2,moveSpeed:null!==(c=t.moveSpeed)&&void 0!==c?c:3.2,intersectMeshCreator:null!==(u=t.intersectMeshCreator)&&void 0!==u?u:function(){return new Pr}})},t.initAnimationEndPose=function(e){var t,n,i,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:Gt(null!==(n=s.latitude)&&void 0!==n?n:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Gt(null!==(i=s.fov)&&void 0!==i?i: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 Gt(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,n=this.camera.aspect,r=this.renderer.getSize(new i.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*n,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.cameraBounce=function(){var e=this.cameraMotion.value,t=e.longitude,n=e.latitude,i=e.fov,r=[{progress:0,value:{longitude:t,latitude:n,fov:i}},{progress:.5,value:{longitude:t,latitude:n,fov:.98*i}},{progress:1,value:{longitude:t,latitude:n,fov:i}}];this.cameraMotion.setKeyframes(r,500).catch(ue)},t.prototype.requestInteriaMovement=function(e,t){var n=this;if(!1!==this.interiaMovement){for(var i=re({},e),r={longitude:0,latitude:0},o=0;o<t;o++)i.longitude*=.996,i.latitude*=.98604,r.longitude+=i.longitude,r.latitude+=i.latitude;var a=Vr(this.cameraMotion.value.longitude+r.longitude),s=Gt(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(ue);var c=i.longitude>1e-4||i.longitude<-1e-4||i.latitude>1e-4||i.latitude<-1e-4;this.emit("interiaPan",l,!c),c?Fe.shared.add((function(e,t){n.requestInteriaMovement(i,0|t)}),!0,1):this.interiaMovement=!1}},t.prototype.onPanGesture=function(e){var t=this.panState,n=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={mouseState:void 0,pointerLength:n,x:e.center.x,y:e.center.y},void 0!==t&&t.pointerLength===n){var i=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pan",i,e.isFinal)){var r={x:e.center.x-t.x,y:e.center.y-t.y},o=this.coordinatesForOffset(r),a=Vr(this.cameraMotion.value.longitude+o.longitude),s=Gt(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",i,e.isFinal),this.emit("panGesture",l,e.isFinal),this.userAction=!0,this.interiaMovement=!1,this.hideIntersectMesh();var c={longitude:l.longitude,latitude:l.latitude,fov:l.fov};if(this.cameraMotion.set(c,0).catch(ue),e.isFinal)if(!this.emit("wantsInteriaPan",l)){this.interiaMovement=!0;var u=e.velocityX,h=.6*e.velocityY;Math.abs(h)>.5&&Math.abs(u)<.5&&(u=0),this.requestInteriaMovement(this.coordinatesForOffset({x:u,y:h}),0)}}}}},t.prototype.onPinchGesture=function(e){var t,n=null===(t=this.pinchState)||void 0===t?void 0:t.fov,i=e.scale,r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==n){var o=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",o,r)){var a=Gt(n/i,this.minFov,this.maxFov);this.emit("wantsPinchGesture",i,a,r)||this.emit("wantsChangeCameraFov",a)||(this.emit("gesture","pinch",o,r),this.emit("pinchGesture",i,a,r),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:a},0).catch(ue),this.onPanGesture(e))}}}else this.pinchState={fov:this.cameraMotion.value.fov}},t.prototype.onMouseWheel=function(e){var t=this,n=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:n}];if(!this.emit("wantsGesture","mouseWheel",i,!1)){var r=Gt(this.cameraMotion.value.fov-n,this.minFov,this.maxFov);this.emit("wantsMouseWheel",n,r,!1)||this.emit("wantsChangeCameraFov",r)||(this.emit("gesture","mouseWheel",i,!1),this.emit("mouseWheel",n,r,!1),this.userAction=!0,this.interiaMovement=!1,this.cameraMotion.set({fov:r},0).catch(ue),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",i,!0)||t.emit("wantsMouseWheel",n,r,!0)||t.emit("wantsChangeCameraFov",r)||(t.emit("gesture","mouseWheel",i,!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}),n=new i.Raycaster;if(n.setFromCamera(t,this.camera),this.emit("wantsShowIntersectionOnModel",n))this.hideIntersectMesh();else{var r=this.model.intersectRaycaster(n)[0];if(r&&r.face){var o=r.face.normal,a=o.clone().multiplyScalar(.05),s=r.point.clone().add(a);this.intersectMesh.position.copy(s);var l=s.clone().add(a);if(this.intersectMesh.lookAt(l),Math.abs(o.y)>.99){var c=this.camera.position.clone().sub(s);this.intersectMesh.rotation.z=-Math.atan2(c.z,c.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",r,this.intersectMesh)}else this.hideIntersectMesh();this.mouseMoveState={clientX:e.clientX,clientY:e.clientY}}}},t.prototype.onMouseOut=function(){this.intersectMesh.parent&&!0===this.intersectMesh.visible&&this.hideIntersectMesh()},t.prototype.onPressGesture=function(e,t){var n,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new i.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}(so);function go(){return Ao||(Ao=new Promise((function(e){var t,n=document.createElement("video");n.muted=!0,n.src="data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0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JAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw",n.addEventListener("timeupdate",(function i(){n.removeEventListener("timeupdate",i,!1),clearTimeout(t);var r=document.createElement("canvas");r.width=r.height=1;var o=r.getContext("2d");o?(o.drawImage(n,0,0,1,1),o.getImageData(0,0,1,1).data[3]>10?e(!0):e(!1)):e(!1)}),!1),n.addEventListener("canplay",(function e(){n.removeEventListener("canplay",e,!1),n.play()}),!1),t=window.setTimeout((function(){return e(!1)}),1e3)})))}var yo,bo=function(e){function t(t,n){return void 0===n&&(n=.5),e.call(this,t,{uniforms:{inputBuffer:new i.Uniform(null),scale:new i.Uniform(n)},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 ie(t,e),t}(io),xo=function(e){function t(t,n){void 0===n&&(n=.002);var r=e.call(this,t,{uniforms:{targetBuffer:new i.Uniform(null),inputBuffer:new i.Uniform(null),step:new i.Uniform(n)},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 ie(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}(io),wo=function(e){function t(t){var n=e.call(this,t,{uniforms:{inputBuffer:new i.Uniform(null),luminanceAdaptiveBuffer:new i.Uniform(null),progress:new i.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 n.material.transparent=!0,n}return ie(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}(io),Mo=function(e){function t(t){var n=e.call(this,t)||this;return n.enableTime=de(),n.renderer=t,n.valuePass=new ro(n.renderer),n.luminancePass=new bo(n.renderer,Math.sqrt(1/3)),n.nextStepPass=new xo(n.renderer,.01),n.luminanceAdaptivePass=new wo(n.renderer),n}return ie(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=de()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new i.WebGLRenderTarget(128,128,{minFilter:i.LinearMipmapLinearFilter,magFilter:i.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:i.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e,this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new i.WebGLRenderTarget(1,1,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new i.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new i.WebGLRenderTarget(1,1,{minFilter:i.NearestFilter,magFilter:i.NearestFilter,type:i.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new i.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((de()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e,t)},t.prototype.dispose=function(){var e,t,n;null===(e=this.luminanceTargetBuffer)||void 0===e||e.dispose(),null===(t=this.luminancePrevBuffer)||void 0===t||t.dispose(),null===(n=this.luminanceNextBuffer)||void 0===n||n.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t}(ao),Co=512,Eo=null!==(yo=Math.SQRT1_2)&&void 0!==yo?yo:Math.sqrt(2),Io={up:new i.Quaternion(Eo,0,0,Eo),down:new i.Quaternion(-Eo,0,0,Eo),left:new i.Quaternion(0,Eo,0,Eo),right:new i.Quaternion(0,-Eo,0,Eo),front:new i.Quaternion(0,0,0,1),back:new i.Quaternion(0,1,0,0)},So=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),Bo=new Float32Array([0,0,1,0,0,1,1,1]),To=new Uint8Array([0,1,2,1,3,2]),Po=new i.BufferGeometry;Po.setAttribute("position",new i.BufferAttribute(So,3)),Po.setAttribute("uv",new i.BufferAttribute(Bo,2)),Po.setIndex(new i.BufferAttribute(To,1));var Ro=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=i.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 ie(t,e),t}(i.ShaderMaterial),Lo=function(e){function t(t,n){var r=e.call(this,Po,new Ro)||this;return t.box.getCenter(r.position),r.quaternion.multiplyQuaternions((new i.Quaternion).setFromAxisAngle(new i.Vector3(0,1,0),-Math.PI),Io[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,n.then((function(e){var t=e[0],n=e[1];r.disposed?(t.dispose(),null==n||n.dispose()):(r.material.map=t,r.material.luminanceMap=n,r.material.needsUpdate=!0,r.material.visible=!0,r.needsRender=!0)})).catch(ue),r}return ie(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}(i.Mesh),Oo=function(e){function t(){var t=e.call(this)||this;return t.needsRender=!1,t.name="tiling",t}return ie(t,e),t}(i.Group),Fo=function(){function e(e,t,n){this.disposed=!1,this.textureLoader=new Mt(e),this.minLevel=t,this.level=0,this.panoIndex=0,this.pedding=0,this.tileTree=Ze(this.minLevel),this.tileMeshes=new Map,this.resource=[],this.luminance=null,this.imageOptions=n,this.object=new Oo,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 n,i;if(!this.disposed&&(this.resource!==e||this.luminance!==t)){this.cleanup(),this.resource=e;var r=null!==(i=null===(n=e.slice().sort((function(e,t){return t.level-e.level}))[0])||void 0===n?void 0:n.level)&&void 0!==i?i:0;this.tileTree=Ze(r),this.luminance=t,this.object.needsRender=!0}},e.prototype.update=function(e,t,n){var r=this;if(!this.disposed){this.level=t;var o=e.planes[5].normal,a=[];t>=this.minLevel&&Je(this.tileTree,(function(n){if(!(n.level<r.minLevel))return!(n.level>t)&&(!!e.intersectsBox(n.box)&&void a.push(n))}));var s=new i.Vector3;a.sort((function(e,t){return e.level!==t.level?e.level-t.level:e.box.getCenter(s).angleTo(o)-t.box.getCenter(s).angleTo(o)}));for(var l=new Set,c=function(e){var t=u.resource.filter((function(t){return t.level===e.level}))[0];if(!t)return"continue";if(l.add(e),u.tileMeshes.has(e))return u.tileMeshes.get(e).activeTime=n,"continue";var i=t.size,o=u.imageOptions.transform,a=Math.pow(2,e.level)*e.position.y,s=Math.pow(2,e.level)*e.position.x,c="".concat(u.panoIndex,".").concat(e.face,".").concat(e.level,".").concat(a,".").concat(s),h=re(re({key:"pano_tile.".concat(c)},un(u.imageOptions,["format","size","quality","sharpen","mappings"])),{size:i*e.size===Co?void 0:Co,cut:[i*e.position.x,i*e.position.y,i*e.size,i*e.size]}),d=u.textureLoader.loadTexture(t[e.face],{imageURL:{transform:o,options:h}}).then((function(e){return e.body})),p=null;if(u.luminance){var f=u.luminance[e.face],A=f.match(/\/cube_(\d+)\//),v=!!A&&Number(A[1]);if(!1!==v){var m=re(re({},h),{size:v*e.size==256?void 0:256,cut:[v*e.position.x,v*e.position.y,v*e.size,v*e.size],key:"pano_tile_luminance.".concat(c)});p=u.textureLoader.loadTexture(f,{imageURL:{transform:u.imageOptions.transform,options:m}}).then((function(e){return e.body})).catch((function(){return null}))}}u.pedding++;var g=Promise.all([d,p]).then((function(e){return r.pedding--,e}),(function(e){return r.pedding--,Promise.reject(e)})),y=new Lo(e,g);y.name="tiling:tile-".concat(c),y.activeTime=n,y.renderOrder=e.level,u.tileMeshes.set(e,y),u.object.needsRender=!0,u.object.add(y)},u=this,h=0,d=a;h<d.length;h++){c(m=d[h])}var p=[];this.tileMeshes.forEach((function(e,n){l.has(n)||p.push(n),e.visible=n.level<=t}));for(var f=p.sort((function(e,t){var n,i,o,a;return(null!==(i=null===(n=r.tileMeshes.get(t))||void 0===n?void 0:n.activeTime)&&void 0!==i?i:0)-(null!==(a=null===(o=r.tileMeshes.get(e))||void 0===o?void 0:o.activeTime)&&void 0!==a?a:0)})).slice(Math.max(0,32-l.size)),A=0,v=f;A<v.length;A++){var m=v[A],g=this.tileMeshes.get(m);g&&(g.dispose(),this.object.remove(g),this.object.needsRender=!0),this.tileMeshes.delete(m)}}},e.prototype.dispose=function(){this.cleanup(),this.resource=[],this.disposed=!0},e}(),ko=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]),Do=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]),Qo=new i.BufferGeometry;Qo.setAttribute("position",new i.BufferAttribute(ko,3)),Qo.setIndex(new i.BufferAttribute(Do,1));var No=function(){function e(){this.material=new i.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 i.Uniform(null),matrix:new i.Uniform(null),alpha:new i.Uniform(null),map:new i.Uniform(null)},depthTest:!1,depthWrite:!1,defines:{USE_PANO_VIDEO:!1},blending:i.CustomBlending,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor}),this.object=new i.Mesh(Qo,this.material),this.object.visible=!1,this.object.renderOrder=-1,this.object.frustumCulled=!1,this.object.name="pano-video",this.alphaMotion=new gr({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(ue),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(ue));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}(),Vo=(new i.Matrix4).makeRotationAxis(new i.Vector3(0,1,0),Math.PI),Uo=new i.Vector3(-1,1,1),zo=function(){function e(e){void 0===e&&(e=0),this.width=e,this.pool=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.pool.length},enumerable:!1,configurable:!0}),e.prototype.create=function(){return new i.WebGLCubeRenderTarget(this.width,{stencilBuffer:!1,depthBuffer:!1})},e.prototype.pop=function(){var e=this.pool.pop();return e||this.create()},e.prototype.push=function(e){-1===this.pool.indexOf(e)&&this.pool.push(e)},e.prototype.clear=function(){for(var e=0,t=this.pool;e<t.length;e++){t[e].dispose()}this.pool.length=0},e}(),qo=function(e){function t(n){var i,r,o,a,s=this,l=t.parseArgs(n);(s=e.call(this,l)||this).TILED_CUBE_TEXTURE_LEVEL=2,s.tileLevel=0,s.initAnimationed=!1,s.forwardPanoIndex=null,s.currentPanoIndex=l.initial[0],s.maxAccessibleDistance=l.maxAccessibleDistance,s.panoTapTriggerRadius=l.panoTapTriggerRadius,s.panoCircleMeshCreator=l.panoCircleMeshCreator,s.tileLevelForFov=l.tileLevelForFov,s.luminanceAdaptiveEffectEnable=l.luminanceAdaptiveEffectEnable,s.colorCubeRenderTargetPool=new zo,s.luminanceCubeRenderTargetPool=new zo;var c=s.model.getMaterial()||{},u=c.pano0,h=c.pano1;u&&(null==h?void 0:h.map)!==u.map&&(s.model.setMaterial({pano0:h}),u.map.dispose(),u.map instanceof wt&&u.map.cubeRenderTarget&&s.colorCubeRenderTargetPool.push(u.map.cubeRenderTarget),u.luminanceMap&&(u.luminanceMap.dispose(),u.luminanceMap instanceof wt&&u.luminanceMap.cubeRenderTarget&&s.luminanceCubeRenderTargetPool.push(u.luminanceMap.cubeRenderTarget)));for(var d=s.colorCubeRenderTargetPool.size;d<2;d++){var p=Math.max(1024*s.TILED_CUBE_TEXTURE_LEVEL,512),f=s.colorCubeRenderTargetPool.create();f.setSize(p,p),rt(null,f,s.renderer),s.colorCubeRenderTargetPool.push(f)}s.panoMeshes=[],s.panoMeshHitTested={},s.updatePanoMeshes(),s.locationMotion=new gr({count:0,distance:s.camera.pose.distance,modelAlpha:null!==(r=null===(i=s.model.getMaterial())||void 0===i?void 0:i.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=Fi()]={panoIndex:s.currentPanoIndex,workCode:s.work.workCode,panoPicture:null!==(a=null===(o=s.model.getMaterial())||void 0===o?void 0:o.pano1)&&void 0!==a?a:null,position:s.camera.pose.offset.clone(),effect:"fly"};var A={allowHosts:s.work.allowHosts,requestProxy:s.requestProxy,networkSubscribe:s.networkSubscribe};return s.textureLoader=new Mt(A),s.tiling=new Fo(A,s.TILED_CUBE_TEXTURE_LEVEL+1,s.imageOptions),s.scene.add(s.tiling.object),s.panoVideo=new No,s.scene.add(s.panoVideo.object),s}return ie(t,e),t.parseArgs=function(t){var n,i,r,o,a,s=e.parseArgs.call(this,t);return re(re({},s),{maxAccessibleDistance:null!==(n=t.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(i=t.panoTapTriggerRadius)&&void 0!==i?i:.5,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new xr},tileLevelForFov:null!==(o=t.tileLevelForFov)&&void 0!==o?o:function(e,t){var n=2*Math.atan(Math.tan(e/180*Math.PI/2)*(t.width/t.height))/Math.PI*180,i=Math.max(t.width/n,t.height/e);return i>60?4:i>30?3:i>18?2:i>12?1:0},luminanceAdaptiveEffectEnable:null===(a=t.luminanceAdaptiveEffectEnable)||void 0===a||a})},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.destroy=function(){var t,n,i=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){i.helper.remove(e),e.dispose()})),this.panoMeshes.length=0),this.interiaMovement=!1;var r=this.videoTexture.image;r.pause(),r.oncanplay=function(){},r.ontimeupdate=function(){},this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},a=o.pano0,s=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var u=c[l],h=this.panoResources[u];if(h.panoPicture){var d=h.panoPicture.map;d&&d!==(null==a?void 0:a.map)&&d!==(null==s?void 0:s.map)&&(d.dispose(),null===(n=h.panoPicture.luminanceMap)||void 0===n||n.dispose(),h.panoPicture=null)}delete this.panoResources[u]}this.luminanceAdaptiveEffect&&(this.luminanceAdaptiveEffect.dispose(),delete this.luminanceAdaptiveEffect)},t.prototype.isReady=function(){return!0===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e,t,n,i=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),r=(null===(e=i.panoPicture)||void 0===e?void 0:e.map)instanceof wt&&null!==(n=null===(t=i.panoPicture)||void 0===t?void 0:t.map.tilePending)&&void 0!==n?n:0,o=this.tiling.pedding;return this.initAnimationed&&r<=0&&o<=0},t.prototype.updateWork=function(e,t,n,i,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:i,longitude:n.longitude,latitude:n.latitude,fov:n.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 n,r,o,a,s,l,c,u,h,d,p=this;if(!this.destroyed){var f=this.currentPanoIndex,A={},v={},m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),x=b[0],w=b[1],M=this.panoResourceFromLocationMotionKeyframe(x),C=this.panoResourceFromLocationMotionKeyframe(w),E=(new i.Vector3).copy(M.position),I=(new i.Vector3).copy(C.position),S=this.locationMotion.value.count-w.value.count+1;A.progress=S,A.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,C.panoPicture&&(S<1?M.panoPicture&&(A.pano0=M.panoPicture):A.pano0=C.panoPicture,A.pano1=C.panoPicture),y=A.useBlackTransition="instant"===C.effect||"montage"===C.effect,"fade"!==C.effect&&"montage"!==C.effect||(A.pano0&&M.panoPicture&&(A.pano0={map:A.pano0.map,luminanceMap:A.pano0.luminanceMap,matrix:M.panoPicture.matrix.clone().setPosition(C.position)}),E.copy(I)),v.distance=this.locationMotion.value.distance,v.offset=new i.Vector3(E.x+(I.x-E.x)*S,E.y+(I.y-E.y)*S,E.z+(I.z-E.z)*S);for(var B=[],T=[],P=0,R=this.locationMotion.keyframes;P<R.length;P++){var L=R[P],O=L.key,F=L.progress;void 0!==O&&(B.push(O),F>=this.locationMotion.progress&&T.push(O))}for(var k=0,D=Object.keys(this.panoResources);k<D.length;k++){var Q=D[k];if(!(T.indexOf(Q)>=0)){var N=this.panoResources[Q];if(N.panoPicture){var V=N.panoPicture.map,U=N.panoPicture.luminanceMap;if(V){if(V===(null===(n=A.pano0)||void 0===n?void 0:n.map))continue;if(V===(null===(r=A.pano1)||void 0===r?void 0:r.map))continue;V instanceof wt&&V.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(V.cubeRenderTarget),V.dispose(),U&&(U instanceof wt&&U.cubeRenderTarget&&this.luminanceCubeRenderTargetPool.push(U.cubeRenderTarget),U.dispose()),N.panoPicture=null}}B.indexOf(Q)>=0||delete this.panoResources[Q]}}M.workCode===C.workCode?this.currentPanoIndex=S<.5?M.panoIndex:C.panoIndex:this.currentPanoIndex=C.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),v.longitude=this.cameraMotion.value.longitude,v.latitude=this.cameraMotion.value.latitude,v.fov=this.cameraMotion.value.fov),!1===Xr(A)&&((null===(o=A.pano0)||void 0===o?void 0:o.map)&&A.pano0.map instanceof wt&&!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 wt&&!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 wt&&!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 wt&&!A.pano1.luminanceMap.cubeRenderTarget&&(A.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(A));var z=!1;if(!1===Xr(v)&&(this.setCamera(v),z=!0),this.currentPanoIndex!==f&&(this.updatePanoMeshesVisible(),z=!0),z)if(te=this.work.observers[this.currentPanoIndex]){var q=Rt(this.camera.pose).normalize(),H=new i.Raycaster(te.position,q);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(H)}if(this.camera.pose.distance>.1||y){var _=this.work.observers[this.currentPanoIndex];if(_)for(var j=0,K=Y=_.visibleNodes.concat(this.currentPanoIndex);j<K.length;j++){var G=K[j];(ee=this.panoMeshes[G])&&ee.setOpacity(0)}}else{var W=this.work.observers[this.currentPanoIndex];if(W){var X=Wr(W.visibleNodes,(function(e){return W.standingPosition.distanceTo(p.work.observers[e].standingPosition)}),!0)[1];X=Gt(X,2.5,1/0);for(var Y=W.visibleNodes.concat(this.currentPanoIndex),Z=this.camera.getDirection(new i.Vector3),J=0,$=Y;J<$.length;J++){G=$[J];var ee,te=this.work.observers[G];if(ee=this.panoMeshes[G])if(te.loadable||te.active){var ne=ee.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);ee.setCurrent(!ee.loading&&0===ee.progress&&this.forwardPanoIndex===G),ee.setOpacity(ne<.01?0:Gt(X/ne*1.2,.4,.85));var ie=this.camera.position.clone().setY(ee.position.y);q=(new i.Vector3).copy(ee.position).sub(ie).normalize();if(G===this.currentPanoIndex){var re=Gt((.5-ie.distanceTo(ee.position))/.5,0,1);q.multiplyScalar(1-re).add(Z.clone().multiplyScalar(re))}q.length()>0&&ee.quaternion.setFromEuler(new i.Euler(0,Math.atan2(q.x,q.z),0)),ee.updateTime&&ee.updateTime(e,t)}else ee.setOpacity(0)}}}var oe=this.tileLevel=function(){if(!1===p.tileLevelForFov)return 0;var e=p.renderer.getDrawingBufferSize(new i.Vector2);e.width*=p.scissor.width,e.height*=p.scissor.height;var t=g.panoIndex,n=p.work.observers[t],r=p.imageOptions.size;if(void 0===r&&n){var o=n.images.up.match(/\/cube_(\d+)\//);o&&(r=Number(o[1]))}void 0===r&&(r=2048);var a=0;r>=1024&&(a=1),r>=2048&&(a=2),r>=4096&&(a=3),r>=8192&&(a=4);var s=p.tileLevelForFov(p.camera.fov,e);return s>a?s:0}(),ae=function(){var e,t=p.camera.quaternion.clone();t.premultiply((null!==(e=p.work.observers[g.panoIndex])&&void 0!==e?e:p.work.observers[p.currentPanoIndex]).quaternion.clone().inverse());var n=(new i.Matrix4).makeRotationFromQuaternion(t),r=(new i.Matrix4).getInverse(n);return(new i.Frustum).setFromProjectionMatrix((new i.Matrix4).multiplyMatrices(p.camera.projectionMatrix,r))}();g.panoIndex===this.currentPanoIndex&&((null===(c=g.panoPicture)||void 0===c?void 0:c.map)instanceof wt&&(g.panoPicture.map.update(ae,oe),!0===g.panoPicture.map.needsRender&&(g.panoPicture.map.needsRender=!1,this.needsRender=!0)),(null===(u=g.panoPicture)||void 0===u?void 0:u.luminanceMap)instanceof wt&&(g.panoPicture.luminanceMap.update(ae,oe),!0===g.panoPicture.luminanceMap.needsRender&&(g.panoPicture.luminanceMap.needsRender=!1,this.needsRender=!0)));var se=this.tiling.object.visible;if(this.initAnimationed){var le=g.panoIndex,ce=this.work.observers[le];ce&&Or(this.camera.position,ce.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==le&&this.tiling.cleanup(),this.tiling.panoIndex=le,this.tiling.setResource(null!==(d=null===(h=ce.images)||void 0===h?void 0:h.tiles)&&void 0!==d?d:[],this.enableIOSEDR&&ce.images.luminance?ce.images.luminance:null),this.tiling.setRotation(ce.quaternion),this.tiling.setPosition(ce.position),oe>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(ae,oe,e):this.tiling.update(ae,0,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;se!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}},t.prototype.render=function(){var t=this.work.observers[this.currentPanoIndex];t&&t.video&&(this.needsRender=!0),e.prototype.render.call(this)},t.prototype.postProcessing=function(e,t){if(!this.destroyed)return this.luminanceAdaptiveEffect||(this.luminanceAdaptiveEffect=new Mo(this.renderer),this.luminanceAdaptiveEffect.enable=this.luminanceAdaptiveEffectEnable),this.luminanceAdaptiveEffect.render(e,t)},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[1],t=this.locationMotion.getKeyFrameSegment(de())[1],n=this.panoResourceFromLocationMotionKeyframe(t),i=this.work.observers[n.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:i?i.position.clone():this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,t,n){var r,o,a,s,l=this;this.userAction=n;var c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=re({key:"pano.".concat(e)},un(this.imageOptions,["format","size","quality","sharpen","mappings"])),f=c.images,A=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,v=d,m={key:"pano_luminance.".concat(e),size:p.size?p.size/2:1024},g=this.enableIOSEDR&&c.images.luminance?c.images.luminance:null,y=function(){if(!c.images.tiles)return null;if(!g)return null;var e=g.up.match(/\/cube_(\d+)\//),t=!!e&&Number(e[1]);return!1===t?null:null==A?void 0:A.map((function(e){return{level:e.level,size:t,back:g.back,front:g.front,left:g.left,right:g.right,up:g.up,down:g.down}}))}(),b="pano:"+dn([f,p,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===b)return;var x=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[x])||void 0===a||a.setProgress(0),this.emit("textureAbort",x,c),this.pendingTextureTask.onError(new Error("texture aborted"))}var w="move-to-pano-"+e;this.pending.add(w);var M,C=this.model.getMaterial()||{},E=C.pano0,I=C.pano1;if(E&&E.map.name===b&&null!==E.luminanceMap===this.enableIOSEDR?M=E:(null==I?void 0:I.map.name)===b&&null!==I.luminanceMap===this.enableIOSEDR&&(M=I),M){var S={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fly",panoPicture:{map:M.map,luminanceMap:M.luminanceMap,matrix:(new i.Matrix4).compose(c.position,c.quaternion,Uo)},position:c.position.clone()};Fe.shared.add((function(){l.pending.delete(w),l.emit("panoLoaded",e),l.doMoveToPano(e,S,t)}),!0,1)}else{this.pendingTextureTask={panoIndex:e,hash:b,onLoad:function(n,r){var o,a;if(l.pending.delete(w),l.destroyed)n.body.dispose();else{n.body.name=b,l.emit("panoLoaded",e);var s={panoIndex:e,workCode:l.work.workCode,effect:null!==(o=t.effect)&&void 0!==o?o:"fly",panoPicture:{map:n.body,luminanceMap:null!==(a=null==r?void 0:r.body)&&void 0!==a?a:null,matrix:(new i.Matrix4).compose(c.position,c.quaternion,Uo)},position:c.position.clone()};l.doMoveToPano(e,s,t)}},onError:function(n){l.pending.delete(w),t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",n,e),l.emit("moveToPanoCanceled",e)}};var B=this.panoMeshes[e];B&&B.tap&&B.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:i.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var n,i;l.emit("textureLoading",t,e,c),(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===b&&(null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(f,{imageURL:{transform:d,options:p},format:i.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var n,i;l.emit("textureLoading",t,e,c),(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===b&&(null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(t))}),this.renderer),g?this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(g,y,{tileImageSize:256,tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):this.textureLoader.loadCubeTexture(g,{imageURL:{transform:v,options:m}},void 0,void 0,void 0,this.renderer).catch((function(){return null})):Promise.resolve(null)]).then((function(t){var n,i,r=t[0],o=t[1];(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===b?(l.pendingTextureTask.onLoad(r,o),null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):(r.body.dispose(),null==o||o.body.dispose())})).catch((function(t){var n,i;(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===b&&(l.pendingTextureTask.onError(t),null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)}},t.prototype.initAnimation=function(e,t,n,i){var r=this;return this.destroyed?Promise.resolve():new Promise((function(o){var a,s,l,c=!1;r.userAction=i,r.moveToPano(e,{longitude:null!==(a=t.longitude)&&void 0!==a?a:r.defaultLongitude,latitude:Gt(null!==(s=t.latitude)&&void 0!==s?s:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Gt(null!==(l=t.fov)&&void 0!==l?l:r.defaultFov,r.minFov,r.maxFov),duration:n,moveStartCallback:function(e,t){c=!0,r.emit("initAnimationWillStart",e,t,r.userAction)},moveEndCallback:function(e,t){r.emit("initAnimationEnded",e,t,r.userAction),r.initAnimationed=!0,o()},moveCancelCallback:function(){var e={longitude:r.camera.pose.longitude,latitude:r.camera.pose.latitude,fov:r.camera.pose.fov,offset:r.camera.pose.offset.clone(),distance:r.camera.pose.distance};!1===c&&r.emit("initAnimationWillStart",r.currentPanoIndex,e,r.userAction),r.emit("initAnimationEnded",r.currentPanoIndex,e,r.userAction),r.initAnimationed=!0,o()}},i)}))},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,n=1;n<e.length;n++){var i=this.panoResourceFromLocationMotionKeyframe(e[n-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[n]).position;t+=i.distanceTo(r)*(e[n].value.count-e[n-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(e){var t=this;void 0===e&&(e=!1);for(var n=this.work.observers[this.currentPanoIndex],r=(n?n.visibleNodes:[]).concat(this.currentPanoIndex),o=[],a=0,s=this.work.observers;a<s.length;a++){var l=s[a],c=this.panoMeshes[l.panoIndex];c&&(r.indexOf(l.panoIndex)>=0?c.parent!==this.helper&&(this.helper.add(c),!0!==this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(l.panoIndex)]&&o.push(l)):c.parent===this.helper&&(this.helper.remove(c),c.setOpacity(0)))}e&&(o=r.map((function(e){return t.work.observers[e]})));for(var u=0,h=o;u<h.length;u++){var d=h[u];if(this.model.loaded&&this.model.bvhs.loaded&&this.model.workCode===this.work.workCode&&r.length<=10){this.panoMeshHitTested["".concat(this.work.workCode,"_").concat(d.panoIndex)]=!0;var p=new i.Vector3(0,-1,0),f=new i.Vector3(0,.1,0).add(d.standingPosition),A=new i.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 n={},i=0,r=this.panoMeshes;i<r.length;i++){n[(f=r[i]).name]=f}this.panoMeshes.length=0,this.panoMeshHitTested={};for(var o=1,a={},s=function(e){if(e.accessibleNodes.length){var n=Wr(e.accessibleNodes,(function(n){return Gt(t.work.observers[n].standingPosition.distanceTo(e.standingPosition),1,1/0)}),!0),i=n[1];void 0===a[e.panoIndex]&&(a[e.panoIndex]=i)}},l=0,c=this.work.observers;l<c.length;l++){s(p=c[l])}var u=Object.keys(a).map((function(e){return a[e]}));u.length&&(o=Gt(.6*(u.reduce((function(e,t){return e+t}),0)/u.length),1,3));for(var h=0;h<this.work.observers.length;h++){var d="panoCircle_".concat(this.work.workCode,"_").concat(h),p=this.work.observers[h],f=void 0;n[d]?(!0===(f=n[d]).loading&&!1===p.loadable&&f.setLoading(!1),delete n[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(n);A<v.length;A++){var m=v[A];this.helper.remove(n[m]),n[m].dispose(),delete n[m]}this.updatePanoMeshesVisible(e)},t.prototype.doMoveToPano=function(e,t,n){var r,o,a,s,l=this;void 0===n&&(n={});var c=de(),u=Fi();this.tiling.cleanup(),this.panoResources[u]=t;var h,d,p;if(this.locationMotion.ended){var f=this.locationMotion.getKeyFrameSegment(c);f[0];var A=f[1],v=this.locationMotion.value,m=(null!==(r=this.panoResourceFromLocationMotionKeyframe(A))&&void 0!==r?r:this.camera).position,g=t.position;h=Math.max(m.distanceTo(g),1),d=[{key:A.key,progress:0,value:re(re({},v),{count:0})},{key:u,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],p=0}else{var y=this.locationMotion.getKeyFrameSegment(c),b=y[0],x=(A=y[1],v=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(b).position),w=(m=this.panoResourceFromLocationMotionKeyframe(A).position,g=t.position,A.value.count-v.count),M=Math.max(x.distanceTo(m),1)*w;h=M+Math.max(m.distanceTo(g),1),d=[{key:b.key,progress:0,value:re({},v)},{key:A.key,progress:M/h,value:A.value},{key:u,progress:1,value:{count:A.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var C=this.locationMotionKeyframesLength(this.locationMotion.keyframes),E=this.locationMotionKeyframesLength(d);p=0===C||0===C?0:this.locationMotion.getProgressVelocity(c)*C/E}var I=this.calculateMovingDuration(n.duration,"fade"===n.effect||"montage"===n.effect?0:h),S={longitude:n.longitude,latitude:n.latitude,fov:n.fov},B={longitude:null!==(o=S.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=S.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=S.fov)&&void 0!==s?s:this.camera.pose.fov,offset:t.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),n.moveStartCallback&&n.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=ue,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(S,I).catch(ue),this.locationMotion.setKeyframes(d,I,p).then((function(){var t,r,o,a={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:l.camera.pose.distance};n.moveEndCallback&&n.moveEndCallback(e,a),l.emit("panoArrived",e,a,l.userAction);var s=l.work.observers[l.currentPanoIndex];if(s&&s.video&&l.videoTexture&&l.videoTexture.image instanceof HTMLVideoElement){var c=Vo.clone().multiply(null!==(o=null===(r=null===(t=l.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===r?void 0:r.matrix)&&void 0!==o?o:new i.Matrix4).multiply(s.video.matrix),u={map:l.videoTexture,size:s.video.size,matrix:c,alpha:1},h=Fi(),d=l.videoTexture.image;d.setAttribute("uuid",h),go().then((function(e){e&&s.video&&d.getAttribute("uuid")===h&&(d.oncanplay=function(){d.oncanplay=ue,d.play()},d.ontimeupdate=function(){d.currentTime>.5&&(d.ontimeupdate=ue,l.panoVideo.setMaterial(u))},d.src=s.video.source)})).catch((function(){d.removeAttribute("uuid")}))}}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,n=this.work.observers[this.currentPanoIndex];if(!n)return null;var r=null!=e?e:new i.Raycaster(this.camera.position.clone(),this.camera.getDirection(new i.Vector3)),o=n.standingPosition.clone();if(n.position.distanceTo(r.ray.origin)>1){var a=this.model.intersectRaycaster(new i.Raycaster(r.ray.origin,new i.Vector3(0,-1,0)))[0];a&&a.distance<=2?o.copy(a.point):o.copy(r.ray.origin).add(new i.Vector3(0,-1.5,0))}var s=this.model.intersectRaycaster(r)[0],l=(s?s.point:r.ray.origin.clone().add(r.ray.direction.clone().normalize().multiplyScalar(3))).clone().sub(o).normalize();if(0===l.length())return null;for(var c=n.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var n=t.work.observers[e],i=n.standingPosition.clone().project(t.camera);return!(Math.abs(i.z)>1)&&(!(Math.abs(i.x)>1)&&(!(Math.abs(i.y)>1)&&(n.loadable||n.active)))})),u=c.slice().sort((function(e,n){return t.work.observers[e].standingPosition.clone().distanceTo(o)-t.work.observers[n].standingPosition.clone().distanceTo(o)})),h=0,d=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];h<d.length;h++)for(var p=d[h],f=0,A=u;f<A.length;f++){var v=A[f],m=this.work.observers[v].standingPosition.clone().sub(o);if(0!==m.length()&&l.angleTo(m)<p)return v}return null},t.prototype.onTapGesture=function(e){var t=this,n=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var r=this.relativeClientPosition(e.center),o=new i.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new i.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var n=t.work.observers[e];return!(n.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(n.loadable||n.active)})),u=this.model.intersectRaycaster(o)[0];if(u){var h=Wr(c,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Ki(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),Ki(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),w=[],M=0,C=m.accessibleNodes;M<C.length;M++){if((d=C[M])!==this.currentPanoIndex&&d!==s){var E=this.work.observers[d].position.clone().sub(m.position).setY(0);x.angleTo(E)<y&&w.push(E)}}var I=(w.length>0?w:oe(oe([],[],!0),[],!0)).slice().sort((function(e,t){return e.angleTo(x)-t.angleTo(x)}))[0];I&&I.angleTo(a)>b&&(g.longitude=Math.atan2(-I.x,-I.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Gt(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(g.fov=this.defaultFov),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(mo),Ho=Math.PI/180,_o=180/Math.PI,jo=.001,Ko=1,Go=function(){var e="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),Wo=function(){var e="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),Xo=function(){var e="undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),Yo=function(){var e="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=e?parseInt(e[1],10):null;return function(){return t}}(),Zo=function(){var e=!1;if(65===Yo()){var t="undefined"!=typeof navigator?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var n=t[1].split(".");n[0],n[1];var i=n[2],r=n[3];e=3325===parseInt(i,10)&&parseInt(r,10)<148}}return function(){return e}}(),Jo=function(){var e=Go()&&Wo()&&"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("13_4");return function(){return e}}(),$o=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 $o()?!e:e}var ta,na=(ta={},function(e,t){void 0===ta[e]&&(console.warn("cardboard: "+t),ta[e]=!0)});function ia(e){var t,n=e.indexOf("://");t=-1!==n?n+3:0;var i=e.indexOf("/",t);return-1===i&&(i=e.length),e.substring(0,i)}var ra,oa=function(e,t,n){var i,r,o,a,s,l,c,u,h,d,p,f,A,v,m,g,y,b,x;i=e,a=(r=t)?r[0]:0,s=r?r[1]:0,l=r?r[2]:0,c=r?r[3]:1,p=a*(u=a+a),f=a*(h=s+s),A=a*(d=l+l),v=s*h,m=s*d,g=l*d,y=c*u,b=c*h,x=c*d,i[0]=1-(v+g),i[1]=f+x,i[2]=A-b,i[3]=0,i[4]=f-x,i[5]=1-(p+g),i[6]=m+y,i[7]=0,i[8]=A+b,i[9]=m-y,i[10]=1-(p+v),i[11]=0,i[12]=o?o[0]:0,i[13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f*x-v*g)*P,e[15]=(u*x-h*y+d*g)*P)}(e,e)},aa=function(){function e(e,t){void 0===e&&(e=new i.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}(),sa=function(){function e(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new aa,this.currentGyroMeasurement=new aa,this.previousGyroMeasurement=new aa,Go()?this.filterQ=new i.Quaternion(-1,0,0,1):this.filterQ=new i.Quaternion(1,0,0,1),this.previousFilterQ=new i.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new i.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new i.Vector3,this.measuredGravity=new i.Vector3,this.gyroIntegralQ=new i.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 n,i=t-this.previousGyroMeasurement.timestampS;n=i,isNaN(n)||n<=jo||n>Ko||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 n=new i.Quaternion;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r,o=new i.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)",_o*((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 i.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 i.Vector3;t.copy(e),t.normalize();var n=new i.Quaternion;return n.setFromUnitVectors(new i.Vector3(0,0,-1),t),n.inverse(),n},e.prototype.gyroToQuaternionDelta_=function(e,t){var n=new i.Quaternion,r=new i.Vector3;return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*t),n},e}(),la=function(){function e(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new i.Quaternion,this.previousTimestampS=null,this.deltaQ=new i.Quaternion,this.outQ=new i.Quaternion}return e.prototype.getPrediction=function(e,t,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new i.Vector3;r.copy(t),r.normalize();var o=t.length();if(o<20*Ho)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(_o*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=n,this.outQ},e}(),ca=function(){function e(e){this.coefficients=e}return e.prototype.distortInverse=function(e){for(var t=0,n=1,i=e-this.distort(t);Math.abs(n-t)>1e-4;){var r=e-this.distort(n),o=n-r*((n-t)/(r-i));t=n,n=o,i=r}return n},e.prototype.distort=function(e){for(var t=e*e,n=0,i=0;i<this.coefficients.length;i++)n=t*(n+this.coefficients[i]);return(n+1)*e},e}(),ua=function(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null},ha=function(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0},da=function(){function e(e,t,n,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=n,this.accelerometer=new i.Vector3,this.gyroscope=new i.Vector3,this.filter=new sa(e,r),this.posePredictor=new la(t,r),this.isFirefoxAndroid=Xo(),this.isIOS=Go();var o=Yo();this.isDeviceMotionInRadians=!this.isIOS&&null!==o&&o<66,this.isWithoutDeviceMotion=Zo()||Jo(),this.filterToWorldQ=new i.Quaternion,Go()?this.filterToWorldQ.setFromAxisAngle(new i.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new i.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new i.Quaternion,this.worldToScreenQ=new i.Quaternion,this.originalPoseAdjustQ=new i.Quaternion;var a="undefined"!=typeof window?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new i.Vector3(0,0,1),a),this.setScreenTransform_(),ea()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new i.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return e.prototype.getPosition=function(){return null},e.prototype.getOrientation=function(){var e;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(r=(new i.Quaternion).setFromAxisAngle(new i.Vector3(0,0,-1),0),o=new i.Quaternion,"undefined"!=typeof window&&-90===window.orientation?o.setFromAxisAngle(new i.Vector3(0,1,0),Math.PI/-2):o.setFromAxisAngle(new i.Vector3(0,1,0),Math.PI/2),r.multiply(o)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((n=new i.Quaternion).setFromAxisAngle(new i.Vector3(1,0,0),-Math.PI/2),n),e=this._deviceOrientationQ;var t=new i.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 n,r,o,a=this.filter.getOrientation();e=this.posePredictor.getPrediction(a,this.gyroscope,this.previousTimestampS);var s=new i.Quaternion;return s.copy(this.filterToWorldQ),s.multiply(this.resetQ),s.multiply(e),s.multiply(this.worldToScreenQ),this.yawOnly&&(s.x=0,s.z=0,s.normalize()),this.orientationOut_[0]=s.x,this.orientationOut_[1]=s.y,this.orientationOut_[2]=s.z,this.orientationOut_[3]=s.w,this.orientationOut_},e.prototype.getPose=function(){var e=new ua;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(),n=this.getEyeOffset(),i=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(i.left),e.rightProjectionMatrix.set(i.right),oa(e.leftViewMatrix,t,n.left),oa(e.rightViewMatrix,t,n.right),e},e.prototype.start=function(){if("undefined"==typeof window)return function(){};var e=this.onDeviceMotion_.bind(this),t=this.onOrientationChange_.bind(this),n=this.onMessage_.bind(this),i=this.onDeviceOrientation_.bind(this);return Go()&&function(){if("undefined"==typeof window)return!1;if("undefined"==typeof document)return!1;var e=window.self!==window.top,t=ia(document.referrer),n=ia(window.location.href);return e&&t!==n}()&&window.addEventListener("message",n),window.addEventListener("orientationchange",t),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",i):window.addEventListener("devicemotion",e),function(){window.removeEventListener("devicemotion",e),window.removeEventListener("deviceorientation",t),window.removeEventListener("orientationchange",t),window.removeEventListener("message",n)}},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,n=this.depthFar,i={left:[],right:[]},r=e.left.upDegrees*Ho,o=e.left.downDegrees*Ho,a=2/((l=e.left.leftDegrees*Ho)+(c=e.left.rightDegrees*Ho)),s=2/(r+o);i.left[0]=a,i.left[1]=0,i.left[2]=0,i.left[3]=0,i.left[4]=0,i.left[5]=s,i.left[6]=0,i.left[7]=0,i.left[8]=-(l-c)*a*.5,i.left[9]=(r-o)*s*.5,i.left[10]=n/(t-n),i.left[11]=-1,i.left[12]=0,i.left[13]=0,i.left[14]=n*t/(t-n),i.left[15]=0;var l,c;r=e.right.upDegrees*Ho,o=e.right.downDegrees*Ho,a=2/((l=e.right.leftDegrees*Ho)+(c=e.right.rightDegrees*Ho)),s=2/(r+o);return i.right[0]=a,i.right[1]=0,i.right[2]=0,i.right[3]=0,i.right[4]=0,i.right[5]=s,i.right[6]=0,i.right[7]=0,i.right[8]=-(l-c)*a*.5,i.right[9]=(r-o)*s*.5,i.right[10]=n/(t-n),i.right[11]=-1,i.right[12]=0,i.right[13]=0,i.right[14]=n*t/(t-n),i.right[15]=0,i},e.prototype.getEyeFieldOfView=function(){var e=this.viewer,t=this.device,n=new ca(e.distortionCoefficients),i=e.screenLensDistance,r=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,a=e.baselineLensDistance-t.bevelMeters,s=t.heightMeters-a,l=_o*Math.atan(n.distort(r/i)),c=_o*Math.atan(n.distort(o/i)),u=_o*Math.atan(n.distort(a/i)),h=_o*Math.atan(n.distort(s/i)),d=new ha,p=new ha;return d.leftDegrees=Math.min(l,e.fov),d.rightDegrees=Math.min(c,e.fov),d.downDegrees=Math.min(u,e.fov),d.upDegrees=Math.min(h,e.fov),p.leftDegrees=d.rightDegrees,p.rightDegrees=d.leftDegrees,p.upDegrees=d.upDegrees,p.downDegrees=d.downDegrees,{left:d,right:p}},e.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new i.Quaternion;var t=e.alpha,n=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new i.Euler(t,n,-r,"YXZ"))},e.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},e.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,n=e.rotationRate,i=e.timeStamp/1e3,r=i-this.previousTimestampS;return r<0?(na("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=i)):r<=jo||r>Ko?(na("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=i)):(t&&(this.accelerometer.set(-t.x,-t.y,-t.z),n&&($o()?this.gyroscope.set(-n.beta,n.alpha,n.gamma):this.gyroscope.set(n.alpha,n.beta,n.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,i)),this.filter.addAccelMeasurement(this.accelerometer,i)),void(this.previousTimestampS=i))},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 i.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new i.Vector3(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},e}(),pa=[0,0,.5,1],fa=[.5,0,.5,1],Aa=function(){function e(e){var t=this;this.renderer=e,this.sensor=new da(.98,.04,!1,!1),this.scale=1,this.cameraL=new i.PerspectiveCamera,this.cameraR=new i.PerspectiveCamera;var n=this.sensor.start();this.dispose=function(){var e=t.renderer.getSize(new i.Vector2);t.renderer.setScissor(0,0,e.width,e.height),t.renderer.setViewport(0,0,e.width,e.height),t.renderer.setScissorTest(!1),n()}}return e.prototype.render=function(e,t){var n=this.renderer.getSize(new i.Vector2);if(n.width>n.height){var r=e.autoUpdate;r&&(e.updateMatrixWorld(),e.autoUpdate=!1);var o={x:Math.round(n.width*pa[0]),y:Math.round(n.height*pa[1]),width:Math.round(n.width*pa[2]),height:Math.round(n.height*pa[3])},a={x:Math.round(n.width*fa[0]),y:Math.round(n.height*fa[1]),width:Math.round(n.width*fa[2]),height:Math.round(n.height*fa[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 i.Vector3).fromArray(s.left),this.scale),this.cameraR.translateOnAxis((new i.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,n.width,n.height),this.renderer.setScissor(0,0,n.width,n.height),this.renderer.setScissorTest(!1),r&&(e.autoUpdate=!0)}else this.renderer.render(e,t)},e.prototype.dispose=function(){},e}(),va={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},ma="undefined"!=typeof navigator&&null!==(ra=va[navigator.language.split("-")[0]])&&void 0!==ra?ra:va.zh,ga="\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+urq4w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JoCBdKinwB09B/DgIICHvELRIQ+RQYuHnqxdjI42ejMqVWpguUWPKNJHFKtKBZJBlD5YpucPh8c/aRLeeHSOK/vgFHzBak93bsgaY3ZIVUl+eQCgVdZPcTsE5RCJqs+/lSrSJUvrhFkBX+RkJdmBXCFr1bRA+drjpp52uS35fPPDWxYQnzFbuJo6zhPnIOt6g5s06QxEfN8PAPGytQUf0JbQRbK+x4YjlR9eDpg9dOdOFjEPv0hXiMgOoJXWe7rblnIbLuWms8mz+oX2kozqEOdrLC1hSpJWVjZB+HS1TSjbgDyWZALPmXXwhdNxOvhCWz20JVyluoIYQKiiyRhqNwG/RvLsiGdW18WI2chw2pEkpRWgLEUICk9V1zf6X56bMKMqz6s+s5QrpWuc2PIlQbBSogAO+XR1Ky6afvy0AuGKniXhPWIWI3U5vdRW4AcCkJArJN7d7SLtlx9VW8pXbdfN/6frfJPYUq58cqWivBpIlTrFRcJOObOe4SKx1Vsj20Cwjam01JODjiUpcbaE9jL4W9Hkla7tNgTI9XgxmtChiMie0F5G/930+vX6wOOsKvinKDlaFdrL4XOcipIACOpcxco820J7BfhsLH1F+jyUQxE2hvYqdEezo8lk8hQIavQFwiwN7ZV5Awa0+Mnh1nen/Z44BkLv9DljYHVorwbfgwGtf4iL2u+03weXYKJKi5pXE0J7FU5Bw8zz+N6Q0F4OD4EwvhWRJoX2UoZhUY9PZ2PYrNBewuAODLzDUMPjMQ8Kd6GIaMZaclxG8FfcIWsxGLkxGOzazl7AYKLn09idtd2qmP7ZiZsK24fHR20MLafPB6O2UTWAP1yGz7GpTmekAAAAAElFTkSuQmCC",");\n background-size: 100%;\n background-repeat: no-repeat;\n}\n.$id-modal-content-guide-phone {\n position: absolute;\n width: 58px;\n height: 56px;\n left: 0;\n top: 0;\n}\n.$id-modal-content-guide-phone-move-x {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-x 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-move-y {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n will-change: transform;\n animation: $id-guide-move-y 4s cubic-bezier(0.42, 0, 0.23, 0.98) 0.5s infinite;\n}\n.$id-modal-content-guide-phone-blink {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n will-change: opacity;\n animation: $id-guide-blink 4s 0.5s infinite;\n}\n.$id-modal-content-guide-phone-image {\n width: 58px;\n height: 56px;\n background-image: url(").concat("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAClCAMAAADyFTYfAAAC+lBMVEUAAABISEhKSkpGRkZERERCQkJOTk45OTlBQUFQUFBSUlJUVFQ7OztYWFg/Pz8/Pz9aWlpkZGQ3NzdcXFxeXl5MTExHR0dhYWFJSUk9PT1WVlZMTEygoKBERERFRUVmZmZQUFA9PT1LS0tra2tPT09ubm5SUlI2NjZXV1czMzOpqalTU1O3t7dVVVVoaGhaWlpqamq1tbWhoaGenp6lpaWurq6ysrJZWVmjo6OgoKBUVFRdXV1cXFyvr6+0tLSwsLCrq6ubm5syMjKbm5twcHCQkJCLi4uGhobLy8uCgoJ9fX1ycnLPz894eHizs7NxcXFgYGCVlZWYmJh7e3umpqa3t7fOzs7JycnFxcWvr6+JiYl0dHRra2uSkpKNjY2IiIi4uLiUlJSsrKx3d3fDw8OHh4eQkJB9fX2dnZ2UlJR/f3++vr6RkZFzc3ODg4OioqKcnJyUlJSCgoJ4eHirq6u4uLh4eHiBgYF2dnaLi4uMjIyjo6OZmZm1tbWwsLCcnJyxsbF6enqAgICwsLC9vb26urqjo6OKioqsrKyWlpaoqKhbW1u2traCgoJ6enqZmZmbm5t+fn6JiYmgoKC0tLS4uLhmZma0tLSYmJhxcXF1dXWlpaWfn5+IiIicnJyzs7Ofn5+xsbGampq7u7vAwMCMjIxgYGChoaGgoKCQkJCOjo5vb2+RkZG1tbWOjo6Hh4d6enq1tbV8fHzGxsZubm5mZmanp6eZmZmvr6+Hh4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XML9YEEFLUKMvlqAp0eWyDEAL65dLqyWo6RekTZ2XNCsD6rgpTK/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(ma.TITLE,'</div>\n <div class="$id-modal-content-hit">').concat(ma.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 ya(e){for(var t=1,n=document.getElementsByTagName("meta"),i=0;i<n.length;i++){var r=n[i];if("viewport"===r.getAttribute("name")){var o=(r.getAttribute("content")||"").match(/initial\-scale\=([\d|\.]+)/);o&&(t=Number(o[1])),isNaN(t)&&(t=1)}}return ga.replace(/\n/g," ").replace(/\ +/g," ").replace(/\$id/g,e).replace(/(\d+)px/g,(function(e,n){return function(e){return Math.floor(e*t)+"px"}(Number(n))}))}var ba=new i.CircleBufferGeometry(.12,16),xa=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 gr({ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}),t.opacityMotion=new gr({opacity:0}),t.loadingMotion=new gr({opacity:0}),t.disableMotion=new gr({opacity:0});var n={blending:i.CustomBlending,blendSrc:i.SrcAlphaFactor,blendDst:i.OneMinusSrcAlphaFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.OneMinusSrcAlphaFactor,depthWrite:!1,transparent:!0};return t.hitTestMesh=new i.Mesh(ba,new i.MeshBasicMaterial(re(re({},n),{color:0,opacity:0}))),t.hitTestMesh.scale.set(1.5,1.5,1.5),t.ringMesh=new i.Mesh(ba,new i.ShaderMaterial(re(re({},n),{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 i.Mesh(ba,new i.ShaderMaterial(re(re({},n),{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 ie(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=Gt(e,0,1),this.opacityMotion.set({opacity:e},30).catch(ue))},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(ue)}else{t=[{progress:0,value:re({},this.currentMotion.value)},{progress:1,value:{ringScale:1.1,ringOpacity:0,circleFade:0,circleOpacity:.85,circleScale:1}}];this.currentMotion.setKeyframes(t,200).catch(ue)}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(ue):this.loadingMotion.set({opacity:0},0).catch(ue),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(ue),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 n=this.opacityMotion.value.opacity,i=this.currentMotion.value,r=i.ringScale,o=i.ringOpacity,a=i.circleFade,s=i.circleOpacity,l=i.circleScale;this.ringMesh.scale.set(r,1,r),this.ringMesh.material.uniforms.opacity.value=o*n,this.panoMesh.material.uniforms.opacity.value=n,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}(i.Object3D),wa=function(e){function t(n){var i=this,r=t.parseArgs(n);(i=e.call(this,r)||this).cardboard=new Aa(i.renderer);var o,a,s,l=(o="five_vr_helper_"+Fi(),a=ya(o),(s=document.createElement("div")).className=o,s.innerHTML=a,s);i.helperElement=l;var c=new Zr(l);return i.element.parentNode&&(i.element.parentNode.insertBefore(l,i.element),i.setHelperElementSize(),c.on("tap",(function(){return i.emit("vrWantsToExit")}))),i.destroyHelper=function(){c.destroy(),l.parentNode&&l.parentNode.removeChild(l),delete i.helperElement},i}return ie(t,e),t.parseArgs=function(t){var n=re(re({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.cardboard.dispose(),this.destroyHelper();for(var t=0,n=this.panoMeshes;t<n.length;t++){var i=n[t];this.helper.remove(i),i.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),n=0,i=this.work.observers;n<i.length;n++){var r=i[n],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 n=this.work.observers[t],i=new xa;i.name="panoSphere_".concat(this.work.workCode,"_").concat(t),i.position.copy(n.position),i.needsRender=!0,this.panoMeshes[t]=i}this.updatePanoMeshesVisible()},t.prototype.updateTime=function(e,t){var n,r,o,a,s,l;if(!this.destroyed){var c=this.currentPanoIndex;this.needsRender=!0;var u={},h={};if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),y=A.position,b=v.position,x=this.locationMotion.value.count-f.value.count+1;u.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,u.useBlackTransition="instant"===v.effect,v.panoPicture&&(x<1?A.panoPicture&&(u.pano0=A.panoPicture):u.pano0=v.panoPicture,u.pano1=v.panoPicture),"fade"===v.effect&&(u.pano0&&A.panoPicture&&(u.pano0={map:u.pano0.map,luminanceMap:u.pano0.luminanceMap,matrix:A.panoPicture.matrix.clone().setPosition(v.position)}),y.copy(b)),u.progress=x,h.distance=this.locationMotion.value.distance,h.offset=new i.Vector3(y.x+(b.x-y.x)*x,y.y+(b.y-y.y)*x,y.z+(b.z-y.z)*x);for(var w=[],M=[],C=0,E=this.locationMotion.keyframes;C<E.length;C++){var I=E[C],S=I.key,B=I.progress;void 0!==S&&(w.push(S),B>=this.locationMotion.progress&&M.push(S))}for(var T=0,P=Object.keys(this.panoResources);T<P.length;T++){var R=P[T];if(!(M.indexOf(R)>=0)){var L=this.panoResources[R];if(L.panoPicture){var O=L.panoPicture.map;if(O){if(O===(null===(n=u.pano0)||void 0===n?void 0:n.map))continue;if(O===(null===(r=u.pano1)||void 0===r?void 0:r.map))continue;O.dispose(),L.panoPicture=null}}w.indexOf(R)>=0||delete this.panoResources[R]}}this.currentPanoIndex=x<.5?A.panoIndex:v.panoIndex,this.emit("movingToPano",g.panoIndex,m.panoIndex,this.locationMotion.progress)}!1===Xr(u)&&((null===(o=u.pano0)||void 0===o?void 0:o.map)&&u.pano0.map instanceof wt&&!u.pano0.map.cubeRenderTarget&&(u.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(a=u.pano0)||void 0===a?void 0:a.luminanceMap)&&u.pano0.luminanceMap instanceof wt&&!u.pano0.luminanceMap.cubeRenderTarget&&(u.pano0.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),(null===(s=u.pano1)||void 0===s?void 0:s.map)&&u.pano1.map instanceof wt&&!u.pano1.map.cubeRenderTarget&&(u.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),(null===(l=u.pano1)||void 0===l?void 0:l.luminanceMap)&&u.pano1.luminanceMap instanceof wt&&!u.pano1.luminanceMap.cubeRenderTarget&&(u.pano1.luminanceMap.cubeRenderTarget=this.luminanceCubeRenderTargetPool.pop()),this.model.setMaterial(u)),h.offset&&this.camera.position.copy(h.offset),this.currentPanoIndex!==c&&this.updatePanoMeshesVisible();var F=this.camera.pose.longitude,k=this.camera.pose.latitude;this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()),this.camera.updateMatrixWorld(),this.camera.computePose();for(var D=0,Q=this.work.observers[this.currentPanoIndex].visibleNodes.concat(this.currentPanoIndex);D<Q.length;D++){var N=Q[D],V=this.work.observers[N],U=this.panoMeshes[N];if(V.loadable||V.active){var z=U.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);z<.05?U.setOpacity(0):U.setOpacity(Gt(1.5/z,0,1)),this.currentPanoIndex===N&&U.setOpacity(0),U.lookAt(this.camera.position)}else U.setOpacity(0)}var q=this.intersect(e);for(N=0;N<this.work.observers.length;N++){null==(U=this.panoMeshes[N])||U.setCurrent(U===q)}for(N=0;N<this.work.observers.length;N++){(U=this.panoMeshes[N])&&U.updateTime&&U.updateTime(e,t)}F===this.camera.pose.longitude&&k===this.camera.pose.latitude||(this.cameraMotion.set(un(this.camera.pose,["longitude","latitude"]),0).catch(ue),this.emit("cameraDirectionUpdate",un(this.camera.pose,["longitude","latitude"]),!0),this.emit("cameraUpdate",Yr(un(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 i.Vector2(this.element.offsetWidth,this.element.offsetHeight),t=e.x*this.scissor.left,n=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=n+"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 n=this.activePanoMesh;return(c=this.panoMeshes.indexOf(n))>=0&&this.moveToPano(c,{},!0),delete this.activePanoMesh,delete this.activeTime,n}for(var r=this.camera.getDirection(new i.Vector3),o=new i.Raycaster(this.camera.position,r),a=void 0,s=[],l=this.work.observers[this.currentPanoIndex].visibleNodes,c=0;c<this.work.observers.length;c++){var u=this.panoMeshes[c];if(-1!==l.indexOf(c)){var h=o.intersectObject(null!==(t=u.hitTestMesh)&&void 0!==t?t:u,!0)[0];h&&s.push({panoMesh:u,intersection:h})}}var d=s.sort((function(e,t){return e.intersection.distance-t.intersection.distance}))[0];if(d?(a=d.intersection,this.activePanoMesh!==d.panoMesh&&(this.activePanoMesh=d.panoMesh,this.activeTime=e),this.intersectMesh.position.copy(d.panoMesh.position),this.intersectMesh.lookAt(this.camera.position),this.intersectMesh.visible=!1):(this.activePanoMesh=void 0,this.activeTime=void 0),!a)if((a=this.model.intersectRaycaster(o)[0])&&a.face){var p=a.face.normal,f=new i.Quaternion;f.setFromUnitVectors(new i.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}(qo),Ma=function(e){function t(n){var i,r,o=this,a=t.parseArgs(n);return(o=e.call(this,a)||this).currentPanoIndex=a.initial[0],o.locationMotion=new gr({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===(i=o.model.getMaterial())||void 0===i?void 0:i.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return ie(t,e),t.parseArgs=function(t){return e.parseArgs.call(this,t)},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.locationMotion.dispose()},t.prototype.isReady=function(){return!1!==this.locationMotion.ended},t.prototype.updateWork=function(e,t,n,i,r){this.work=e,this.currentPanoIndex=t,this.hideIntersectMesh();var o={duration:0,longitude:n.longitude,latitude:n.latitude,fov:n.fov};return this.moveToPano(t,o,r),!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var n={},r={};if(!this.locationMotion.ended){this.locationMotion.update(e),n.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z);var o=new i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),a=Wr(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),Xr(n)||this.model.setMaterial(n),Xr(r)||this.setCamera(r)}},t.prototype.initAnimation=function(e,t,n,i){var r=this;return this.destroyed?Promise.resolve():new Promise((function(o){var a,s,l;r.userAction=i,r.moveToPano(e,{longitude:null!==(a=t.longitude)&&void 0!==a?a:r.defaultLongitude,latitude:Gt(null!==(s=t.latitude)&&void 0!==s?s:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Gt(null!==(l=t.fov)&&void 0!==l?l:r.defaultFov,r.minFov,r.maxFov),duration:n,moveStartCallback:function(e,t){r.emit("initAnimationWillStart",e,t,r.userAction)},moveEndCallback:function(e,t){r.emit("initAnimationEnded",e,t,r.userAction),o()},moveCancelCallback:function(){var e=r.currentPanoIndex,t={longitude:r.camera.pose.longitude,latitude:r.camera.pose.latitude,fov:r.camera.pose.fov,offset:r.camera.pose.offset.clone(),distance:r.camera.pose.distance};r.emit("initAnimationEnded",e,t,r.userAction),o()}},i)}))},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[1],t=this.locationMotion.getKeyFrameSegment(de())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:new i.Vector3(t.value.x,t.value.y,t.value.z),distance:t.value.distance}},t.prototype.moveToPano=function(e,t,n){void 0===t&&(t={});var i=this.work.observers[e];i&&this.moveToPosition(i.position,t,n)},t.prototype.moveToPosition=function(e,t,n){var r,o,a,s=this;void 0===t&&(t={}),this.userAction=n;for(var l=de(),c=new i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z).distanceTo(e),u=this.locationMotion.getProgressVelocity(l),h=0,d=1;d<this.locationMotion.keyframes.length;d++){var p=this.locationMotion.keyframes[d-1].value,f=p.x,A=p.y,v=p.z,m=this.locationMotion.keyframes[d].value,g=m.x,y=m.y,b=m.z;h+=Math.sqrt(Math.pow(g-f,2)+Math.pow(y-A,2)+Math.pow(b-v,2))}var x=0===c?0:u*h/c,w=this.calculateMovingDuration(t.duration,c),M={x:e.x,y:e.y,z:e.z,distance:0,modelAlpha:1,perspToOrtho:0,orthoDistance:1},C={longitude:t.longitude,latitude:t.latitude,fov:t.fov},E={longitude:null!==(r=C.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=C.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=C.fov)&&void 0!==a?a:this.camera.pose.fov,offset:e.clone(),distance:0},I=Wr(this.work.observers,(function(t){return t.position.distanceTo(e)})),S=this.work.observers.indexOf(I);this.emit("moveToPano",S,this.userAction),t.moveStartCallback&&t.moveStartCallback(S,E),this.emit("panoWillArrive",S,E,this.userAction),this.cameraMotion.set(C,w).catch(ue),this.locationMotion.set(M,w,x).then((function(){var e=Yr(s.camera.pose);t.moveEndCallback&&t.moveEndCallback(S,e),s.emit("panoArrived",S,e,s.userAction)}),(function(){t.moveCancelCallback&&t.moveCancelCallback(),s.emit("moveToPanoCanceled",S)}))},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var n=this.relativeClientPosition(e.center),r=new i.Raycaster;if(r.setFromCamera(n,this.camera),!this.emit("wantsTapGesture",r,n,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,n,!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 i.Vector3(0,1,0).angleTo(a)>Math.PI/3){var l=this.camera.position.clone().setY(s.y),c=s.clone().sub(l).setLength(.3),u=s.clone().sub(c);r.set(u,new i.Vector3(0,-1,0)),o=this.model.intersectRaycaster(r)[0]}}if(o){var h=o.point.clone(),d=Wr(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}(mo),Ca=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("{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"),Ea=function(){return arguments[0].split("").map((function(e){return e.charCodeAt(0)>126?e:String.fromCharCode((e.charCodeAt(0)+113)%126)})).join("")}("{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"),Ia=Object.assign({opacity:new i.Uniform(1),scale:new i.Uniform(13.1),panoMap:new i.Uniform(null),panoDisplacementMap:new i.Uniform(null),panoPosition:new i.Uniform(new i.Vector3),panoMatrix:new i.Uniform(new i.Matrix4)},{emissive:new i.Uniform(new i.Color(0)),emissiveMap:new i.Uniform(null),specular:new i.Uniform(new i.Color(1118481)),specularMap:new i.Uniform(null),normalMap:new i.Uniform(null),bumpMap:new i.Uniform(null),shininess:new i.Uniform(30)},i.UniformsLib.common,i.UniformsLib.lights),Sa=new i.SphereBufferGeometry(.01,128,128);var Ba=function(){function e(e){void 0===e&&(e={}),this.textureLoader=new Mt({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,n,r,o,a,s,l,c){var u=[0,0],h=function(e,t){u[t]=e,l(.8*u[0]+.2*u[1])},d=[this.textureLoader.loadTexture(e,{imageURL:n,viaAjax:!0},void 0,void 0,(function(e){return h(e,1)}),c),this.textureLoader.loadCubeTexture(t,{imageURL:n,viaAjax:!0},void 0,void 0,(function(e){return h(e,0)}),c)];return Promise.all(d).then((function(e){var t=e[0],n=e[1],s=function(e,t,n,r){var o=new i.ShaderMaterial({side:i.BackSide,vertexShader:Ca,fragmentShader:Ea,transparent:!0,uniforms:i.UniformsUtils.clone(Ia)}),a=t;return a.needsUpdate=!0,a.minFilter=i.LinearFilter,a.magFilter=i.LinearFilter,e.needsUpdate=!0,e.minFilter=i.LinearFilter,e.magFilter=i.LinearFilter,o.uniforms.opacity.value=0,o.uniforms.panoMap.value=a,o.uniforms.panoDisplacementMap.value=e,o.uniforms.panoPosition.value=n,o.uniforms.panoMatrix.value=r,Object.assign(new i.Mesh(Sa,o),{frustumCulled:!1,dispose:function(){this.material instanceof i.ShaderMaterial&&(this.material.uniforms.panoDisplacementMap.value.dispose(),this.material.uniforms.panoDisplacementMap.value=null,this.material.dispose())}})}(t.body,n.body,r,o),l={body:s,meta:oe([t.meta],n.meta,!0)};return a(l),l})).catch((function(e){for(var t=0,n=d;t<n.length;t++){n[t].then((function(e){return e.body.dispose()})).catch(ue)}return s(e),Promise.reject(e)}))},e}(),Ta=new i.Vector3(-1,1,1),Pa=function(e){function t(n){var r,o,a,s,l,c=this,u=t.parseArgs(n);return(c=e.call(this,u)||this).currentPanoIndex=u.initial[0],c.forwardPanoIndex=null,c.maxAccessibleDistance=u.maxAccessibleDistance,c.panoTapTriggerRadius=u.panoTapTriggerRadius,c.panoCircleMeshCreator=u.panoCircleMeshCreator,c.panoModelGroup=new i.Group,c.panoModelGroup.name="panoModels",c.scene.add(c.panoModelGroup),c.panoMeshes=[],c.updatePanoMeshes(),c.helper.remove(c.intersectMesh),c.locationMotion=new gr({count:0,distance:c.camera.pose.distance,modelAlpha:null!==(o=null===(r=c.model.getMaterial())||void 0===r?void 0:r.modelAlpha)&&void 0!==o?o:0,perspToOrtho:c.camera.perspToOrtho.x,orthoDistance:c.camera.orthoDistance}),c.panoResources={},c.panoResources[c.locationMotion.keyframes[0].key=c.locationMotion.keyframes[1].key=Fi()]={panoIndex:c.currentPanoIndex,workCode:c.work.workCode,matrix:null!==(l=null===(s=null===(a=c.model.getMaterial())||void 0===a?void 0:a.pano1)||void 0===s?void 0:s.matrix)&&void 0!==l?l:new i.Matrix4,position:c.camera.pose.offset.clone(),effect:"fly"},c.depthTextureLoader=new Ba({allowHosts:c.work.allowHosts,requestProxy:c.requestProxy,networkSubscribe:c.networkSubscribe}),c}return ie(t,e),t.parseArgs=function(t){var n,i,r,o=e.parseArgs.call(this,t);return re(re({},o),{maxAccessibleDistance:null!==(n=t.maxAccessibleDistance)&&void 0!==n?n:5,panoTapTriggerRadius:null!==(i=t.panoTapTriggerRadius)&&void 0!==i?i:1,panoCircleMeshCreator:null!==(r=t.panoCircleMeshCreator)&&void 0!==r?r:function(e){return new xr}})},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.destroy=function(){var t,n=this;if(e.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.pendingTextureTask,this.model&&(this.model.visible=!0),this.panoModelGroup){for(var i=0,r=this.panoModelGroup.children;i<r.length;i++){var o=r[i];"function"==typeof o.dispose&&o.dispose()}this.scene.remove(this.panoModelGroup)}this.panoMeshes&&(this.panoMeshes.forEach((function(e){n.helper.remove(e),e.dispose()})),this.panoMeshes.length=0);for(var a=null!==(t=this.model.getMaterial())&&void 0!==t?t:{},s=a.pano0,l=a.pano1,c=0,u=Object.keys(this.panoResources);c<u.length;c++){var h=u[c],d=this.panoResources[h];d.panoModel&&d.panoModel.material.uniforms.panoMap.value!==(null==s?void 0:s.map)&&d.panoModel.material.uniforms.panoMap.value!==(null==l?void 0:l.map)&&(this.panoModelGroup.remove(d.panoModel),d.panoModel.material.uniforms.panoMap.value.dispose(),d.panoModel.dispose(),delete d.panoModel),delete this.panoResources[h]}this.interiaMovement=!1},t.prototype.isReady=function(){return!1===this.locationMotion.ended&&e.prototype.isReady.call(this)},t.prototype.updateWork=function(e,t,n,i,r){return this.work=e,this.currentPanoIndex=t,this.depthTextureLoader.setAllowHosts(this.work.allowHosts),this.hideIntersectMesh(),this.updatePanoMeshes(),this.moveToPano(t,{effect:"fade",duration:i,longitude:n.longitude,latitude:n.latitude,fov:n.fov},r),!0},t.prototype.updateTime=function(e,t){var n,r,o=this;if(!this.destroyed){var a=this.currentPanoIndex,s={},l={},c=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),u=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),h=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var d=this.locationMotion.getKeyFrameSegment(e),p=d[0],f=d[1],A=this.panoResourceFromLocationMotionKeyframe(p),v=this.panoResourceFromLocationMotionKeyframe(f),m=(new i.Vector3).copy(A.position),g=(new i.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(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance;for(var b=0,x=this.panoModelGroup.children;b<x.length;b++){var w=x[b];w.visible=w===A.panoModel||w===v.panoModel}A.panoModel&&(A.panoModel.material.uniforms.opacity.value=1-y,A.panoModel.material.depthTest=0!==y),v.panoModel&&(v.panoModel.material.uniforms.opacity.value=y,v.panoModel.material.depthTest=1!==y),v.panoModel&&(y<1?A.panoModel&&(s.pano0={map:A.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:A.matrix}):s.pano0={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix},s.pano1={map:v.panoModel.material.uniforms.panoMap.value,luminanceMap:null,matrix:v.matrix}),h=s.useBlackTransition="instant"===v.effect||"montage"===v.effect,"fade"!==v.effect&&"montage"!==v.effect||(s.pano0&&(s.pano0={map:s.pano0.map,luminanceMap:null,matrix:A.matrix.clone().setPosition(v.position)}),m.copy(g)),l.distance=this.locationMotion.value.distance,l.offset=new i.Vector3(m.x+(g.x-m.x)*y,m.y+(g.y-m.y)*y,m.z+(g.z-m.z)*y);for(var M=[],C=[],E=0,I=this.locationMotion.keyframes;E<I.length;E++){var S=I[E],B=S.key,T=S.progress;void 0!==B&&(M.push(B),T>=this.locationMotion.progress&&C.push(B))}for(var P=0,R=Object.keys(this.panoResources);P<R.length;P++){var L=R[P];if(!(C.indexOf(L)>=0)){var O=this.panoResources[L];if(O.panoModel){if(O.panoModel.material.uniforms.panoMap.value===(null===(n=s.pano0)||void 0===n?void 0:n.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}M.indexOf(L)>=0||delete this.panoResources[L]}}A.workCode===v.workCode?this.currentPanoIndex=y<.5?A.panoIndex:v.panoIndex:this.currentPanoIndex=v.panoIndex,this.emit("movingToPano",u.panoIndex,c.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),l.longitude=this.cameraMotion.value.longitude,l.latitude=this.cameraMotion.value.latitude,l.fov=this.cameraMotion.value.fov),!1===Xr(s)&&this.model.setMaterial(s);var F=!1;if(!1===Xr(l)&&(this.setCamera(l),F=!0),this.currentPanoIndex!==a&&(this.updatePanoMeshesVisible(),F=!0),F)if(W=this.work.observers[this.currentPanoIndex]){var k=Rt(this.camera.pose).normalize(),D=new i.Raycaster(W.position,k);this.forwardPanoIndex=this.getForwardPanoIndexOrNot(D)}if(this.camera.pose.distance>.1||h){var Q=this.work.observers[this.currentPanoIndex];if(Q)for(var N=0,V=H=Q.visibleNodes.concat(this.currentPanoIndex);N<V.length;N++){var U=V[N];(G=this.panoMeshes[U])&&G.setOpacity(0)}}else{var z=this.work.observers[this.currentPanoIndex];if(z){var q=Wr(z.visibleNodes,(function(e){return z.standingPosition.distanceTo(o.work.observers[e].standingPosition)}),!0)[1];q=Gt(q,2.5,1/0);for(var H=z.visibleNodes.concat(this.currentPanoIndex),_=this.camera.getDirection(new i.Vector3),j=0,K=H;j<K.length;j++){U=K[j];var G,W=this.work.observers[U];if(G=this.panoMeshes[U])if(W.loadable||W.active){var X=G.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);G.setCurrent(!G.loading&&0===G.progress&&this.forwardPanoIndex===U),G.setOpacity(X<.01?0:Gt(q/X*1.2,.65,.98));var Y=this.camera.position.clone().setY(G.position.y);k=(new i.Vector3).copy(G.position).sub(Y).normalize();if(U===this.currentPanoIndex){var Z=Gt((.5-Y.distanceTo(G.position))/.5,0,1);k.multiplyScalar(1-Z).add(_.clone().multiplyScalar(Z))}k.length()>0&&G.quaternion.setFromEuler(new i.Euler(0,Math.atan2(k.x,k.z),0)),G.updateTime&&G.updateTime(e,t)}else G.setOpacity(0)}}}}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[1],t=this.locationMotion.getKeyFrameSegment(de())[1],n=this.panoResourceFromLocationMotionKeyframe(t),i=this.work.observers[n.panoIndex];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:i?i.position.clone():this.camera.position.clone(),distance:0}},t.prototype.moveToPano=function(e,t,n){var r,o=this;void 0===t&&(t={}),this.userAction=n;var a=this.work.observers[e].images.depth,s=re({key:"pano.".concat(e)},un(this.imageOptions,["format","size","quality","sharpen","mappings"])),l=this.imageOptions.transform,c=this.work.observers[e].images,u=this.work.observers[e],h=u.position,d=u.quaternion,p=(new i.Matrix4).compose(h,d,new i.Vector3(-1,1,1)),f="pano:"+dn(c);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===f)return;var A=this.pendingTextureTask.panoIndex;null===(r=this.panoMeshes[A])||void 0===r||r.setProgress(0),this.emit("textureAbort",A,this.work.observers[A]),this.pendingTextureTask.onError(new Error("texture aborted"))}var v="move-to-pano-"+e;this.pending.add(v),this.pendingTextureTask={panoIndex:e,hash:f,onLoad:function(n){o.pending.delete(v),o.destroyed?n.body.dispose():(n.body.name=f,o.emit("panoLoaded",e),o.doMoveToPano(e,n.body,t))},onError:function(n){o.pending.delete(v),t.moveCancelCallback&&t.moveCancelCallback(),o.emit("panoLoadError",n,e),o.emit("moveToPanoCanceled",e)}};var m=this.panoMeshes[e];m&&m.tap&&m.tap(),this.depthTextureLoader.load(a,c,{transform:l,options:s},h,p,(function(t){var n,i;(null===(n=o.pendingTextureTask)||void 0===n?void 0:n.hash)===f?(o.pendingTextureTask.onLoad(t),null===(i=o.panoMeshes[e])||void 0===i||i.setProgress(0),delete o.pendingTextureTask,o.emit("textureLoaded",e,o.work.observers[e],t.meta)):t.body.dispose()}),(function(t){var n,i;(null===(n=o.pendingTextureTask)||void 0===n?void 0:n.hash)===f&&(o.pendingTextureTask.onError(t),null===(i=o.panoMeshes[e])||void 0===i||i.setProgress(0),delete o.pendingTextureTask,o.emit("textureError",t,e,o.work.observers[e]),o.emit("error",t))}),(function(t){var n,i;o.emit("textureLoading",t,e,o.work.observers[e]),(null===(n=o.pendingTextureTask)||void 0===n?void 0:n.hash)===f&&(null===(i=o.panoMeshes[e])||void 0===i||i.setProgress(t))}),this.renderer),this.emit("textureStartLoad",e,this.work.observers[e])},t.prototype.initAnimation=function(e,t,n,i){var r=this;return this.destroyed?Promise.resolve():new Promise((function(o){var a,s,l,c=!1;r.userAction=i,r.moveToPano(e,{longitude:null!==(a=t.longitude)&&void 0!==a?a:r.defaultLongitude,latitude:Gt(null!==(s=t.latitude)&&void 0!==s?s:r.defaultLatitude,r.minLatitude,r.maxLatitude),fov:Gt(null!==(l=t.fov)&&void 0!==l?l:r.defaultFov,r.minFov,r.maxFov),duration:n,moveStartCallback:function(e,t){c=!0,r.emit("initAnimationWillStart",e,t,r.userAction)},moveEndCallback:function(e,t){r.emit("initAnimationEnded",e,t,r.userAction),o()},moveCancelCallback:function(){var e=Yr(r.camera.pose);!1===c&&r.emit("initAnimationWillStart",r.currentPanoIndex,e,r.userAction),r.emit("initAnimationEnded",r.currentPanoIndex,e,r.userAction),o()}},i)}))},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var t=0,n=1;n<e.length;n++){var i=this.panoResourceFromLocationMotionKeyframe(e[n-1]).position,r=this.panoResourceFromLocationMotionKeyframe(e[n]).position;t+=i.distanceTo(r)*(e[n].value.count-e[n-1].value.count)}return t},t.prototype.updatePanoMeshesVisible=function(){for(var e=this.work.observers[this.currentPanoIndex],t=(e?e.visibleNodes:[]).concat(this.currentPanoIndex),n=0,i=this.work.observers;n<i.length;n++){var r=i[n],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={},n=0,i=this.panoMeshes;n<i.length;n++){t[(p=i[n]).name]=p}this.panoMeshes.length=0;for(var r=1,o={},a=function(t){var n=Wr(t.accessibleNodes,(function(n){return Gt(e.work.observers[n].standingPosition.distanceTo(t.standingPosition),1,1/0)}),!0),i=n[1];void 0===o[t.panoIndex]&&(o[t.panoIndex]=i)},s=0,l=this.work.observers;s<l.length;s++){a(d=l[s])}var c=Object.keys(o).map((function(e){return o[e]}));c.length&&(r=Gt(.6*(c.reduce((function(e,t){return e+t}),0)/c.length),1,3));for(var u=0;u<this.work.observers.length;u++){var h="panoCircle_".concat(this.work.workCode,"_").concat(u),d=this.work.observers[u],p=void 0;t[h]?(!0===(p=t[h]).loading&&!1===d.loadable&&p.setLoading(!1),delete t[h]):(p=this.panoCircleMeshCreator(u)).name=h,p.scale.set(r,1,r),p.position.copy(d.standingPosition),this.panoMeshes[u]=p}for(var f=0,A=Object.keys(t);f<A.length;f++){var v=A[f];this.helper.remove(t[v]),t[v].dispose(),delete t[v]}this.updatePanoMeshesVisible()},t.prototype.doMoveToPano=function(e,t,n){var r,o,a,s,l=this;void 0===n&&(n={});var c=de(),u=Fi(),h=this.work.observers[e],d=this.panoResources[u]={panoIndex:e,workCode:this.work.workCode,effect:null!==(r=n.effect)&&void 0!==r?r:"fly",panoModel:t,matrix:(new i.Matrix4).compose(h.position,h.quaternion,Ta),position:h.position.clone()};t.visible=!1,t.renderOrder=-1,this.panoModelGroup.add(t);var p,f,A;if(this.locationMotion.ended){var v=this.locationMotion.getKeyFrameSegment(c);v[0];var m=v[1],g=this.locationMotion.value,y=this.panoResourceFromLocationMotionKeyframe(m).position,b=d.position;p=Math.max(y.distanceTo(b),1),f=[{key:m.key,progress:0,value:re(re({},g),{count:0})},{key:u,progress:1,value:{distance:0,perspToOrtho:0,modelAlpha:0,orthoDistance:1,count:1}}],A=0}else{var x=this.locationMotion.getKeyFrameSegment(c),w=x[0],M=(m=x[1],g=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(w).position),C=(y=this.panoResourceFromLocationMotionKeyframe(m).position,b=d.position,m.value.count-g.count),E=Math.max(M.distanceTo(y),1)*C;p=E+Math.max(y.distanceTo(b),1),f=[{key:w.key,progress:0,value:re({},g)},{key:m.key,progress:E/p,value:m.value},{key:u,progress:1,value:{count:m.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var I=this.locationMotionKeyframesLength(this.locationMotion.keyframes),S=this.locationMotionKeyframesLength(f);A=0===I||0===I?0:this.locationMotion.getProgressVelocity(c)*I/S}var B=this.calculateMovingDuration(n.duration,"fade"===n.effect||"montage"===n.effect?0:p),T={longitude:n.longitude,latitude:n.latitude,fov:n.fov},P={longitude:null!==(o=T.longitude)&&void 0!==o?o:this.camera.pose.longitude,latitude:null!==(a=T.latitude)&&void 0!==a?a:this.camera.pose.latitude,fov:null!==(s=T.fov)&&void 0!==s?s:this.camera.pose.fov,offset:h.position.clone(),distance:this.camera.pose.distance};this.emit("moveToPano",e,this.userAction),n.moveStartCallback&&n.moveStartCallback(e,P),this.emit("panoWillArrive",e,P,this.userAction),this.cameraMotion.set(T,B).catch(ue),this.locationMotion.setKeyframes(f,B,A).then((function(){var t={longitude:l.camera.pose.longitude,latitude:l.camera.pose.latitude,fov:l.camera.pose.fov,offset:l.camera.pose.offset.clone(),distance:l.camera.pose.distance};n.moveEndCallback&&n.moveEndCallback(e,t),l.emit("panoArrived",e,t,l.userAction)}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),l.emit("moveToPanoCanceled",e)}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this,n=this.camera.getDirection(new i.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 n=t.work.observers[e],o=n.standingPosition.clone().sub(r);return 0!==o.length()&&(!(o.angleTo(new i.Vector3(0,-1,0))<Math.PI/12)&&(n.loadable||n.active))})),s=(e?e.ray.direction.clone():n.clone()).setY(0);if(0===s.length())return null;for(var l=a.slice().sort((function(e,n){var i=t.work.observers[e].position.clone().setY(r.y),o=t.work.observers[n].position.clone().setY(r.y);return i.distanceTo(r)-o.distanceTo(r)})),c=0,u=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];c<u.length;c++)for(var h=u[c],d=0,p=l;d<p.length;d++){var f=p[d],A=this.work.observers[f].position.clone().setY(r.y).sub(r);if(0!==A.length()&&s.angleTo(A)<h)return f}return null},t.prototype.onTapGesture=function(e){var t=this,n=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","tap",n,!0)){var r=this.relativeClientPosition(e.center),o=new i.Raycaster;if(o.setFromCamera(r,this.camera),!this.emit("wantsTapGesture",o,r,!0)){this.emit("gesture","tap",n,!0),this.emit("tapGesture",o,r,!0),this.interiaMovement=!1;var a=this.camera.getDirection(new i.Vector3).setY(0),s=null,l=this.work.observers[this.currentPanoIndex];if(l){var c=l.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var n=t.work.observers[e];return!(n.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(n.loadable||n.active)})),u=o.intersectObject(this.boundingMesh,!0)[0];if(u){var h=Wr(c,(function(e){var n=t.work.observers[e].standingPosition.clone();return n.clone().sub(t.camera.position).setY(0).angleTo(a)>Math.PI/2?1/0:n.distanceTo(u.point)}),!0),d=h[0];h[1]<this.panoTapTriggerRadius&&(s=d)}Ki(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),Ki(s))!0===this.locationMotion.ended&&this.cameraBounce();else{var m=this.work.observers[s];if(m.active){for(var g={},y=Math.PI/6,b=Math.PI/12,x=new i.Vector3(0,1,0),w=m.position.clone().setY(0).sub(l.position.clone().setY(0)).normalize(),M=w.clone().applyAxisAngle(x,y),C=w.clone().applyAxisAngle(x,-y),E=[],I=[],S=[],B=0,T=m.accessibleNodes;B<T.length;B++){if((d=T[B])!==this.currentPanoIndex&&d!==s){var P=this.work.observers[d].position.clone().sub(m.position).setY(0);w.angleTo(P)<y?S.push(P):M.angleTo(P)<y?E.push(P):C.angleTo(P)<y&&I.push(P)}}var R=(S.length>0?S:oe(oe([],E,!0),I,!0)).slice().sort((function(e,t){return e.angleTo(w)-t.angleTo(w)}))[0];R&&R.angleTo(a)>b&&(g.longitude=Math.atan2(-R.x,-R.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(g.latitude=Gt(0,this.minLatitude,this.maxLatitude)),this.emit("wantsMoveToPano",s,g,!0)}else this.panoMeshes[s]&&(this.panoMeshes[s].setDisabled(!1),this.panoMeshes[s].setLoading(!0))}}}}},t}(mo),Ra=80;function La(e,t){var n=new i.Vector3;return n.setFromMatrixColumn(t,0),n.multiplyScalar(-e),n}function Oa(e){var t=new i.Vector3;return t.x=0,t.z=0,t.y=e,t}var Fa=function(e){function t(n){var i,r,o=this,a=t.parseArgs(n);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 gr({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===(i=o.model.getMaterial())||void 0===i?void 0:i.modelAlpha)&&void 0!==r?r:0,perspToOrtho:o.camera.perspToOrtho.x,orthoDistance:o.camera.orthoDistance}),o}return ie(t,e),t.parseArgs=function(t){var n,i,r,o,a,s,l,c=e.parseArgs.call(this,t);return re(re({},c),{defaultLongitude:null!==(n=t.defaultLongitude)&&void 0!==n?n:Math.PI/4,defaultLatitude:null!==(i=t.defaultLatitude)&&void 0!==i?i: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:0})},t.distanceFromModel=function(e,t,n){var i=e.bounding,r=Math.pow(Math.pow(i.max.x-i.min.x+1,2)+Math.pow(i.max.y-i.min.y+1,2)+Math.pow(i.max.z-i.min.z+1,2),.5),o=r/2/Math.tan(Math.PI*t/360);return n<1&&(o/=n),isNaN(o)?r:o},t.initAnimationEndPose=function(e){var n,r,o,a,s,l=this.parseArgs(e);e.initial[0];var c=e.initial[1];return{longitude:null!==(n=c.longitude)&&void 0!==n?n:l.defaultLongitude,latitude:null!==(r=c.latitude)&&void 0!==r?r:l.defaultLatitude,fov:null!==(o=c.fov)&&void 0!==o?o:Ra,offset:null!==(a=c.offset)&&void 0!==a?a:e.model.bounding.getCenter(new i.Vector3),distance:null!==(s=c.distance)&&void 0!==s?s:t.distanceFromModel(l.model,Ra,l.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.updateCamera=function(e,t,n){var i,r,o;this.userAction=n;var a={longitude:e.longitude,latitude:e.latitude,fov:e.fov},s={x:null===(i=e.offset)||void 0===i?void 0:i.x,y:null===(r=e.offset)||void 0===r?void 0:r.y,z:null===(o=e.offset)||void 0===o?void 0:o.z,distance:e.distance};return Promise.all([this.locationMotion.set(s,t),this.cameraMotion.set(a,t).catch(ue)])},t.prototype.updateWork=function(e,t,n,i,r){return this.work=e,this.updateCamera(n,i,r),!0},t.prototype.updateModel=function(t){e.prototype.updateModel.call(this,t);var n=t.bounding.getCenter(new i.Vector3);this.locationMotion.set({x:n.x,y:n.y,z:n.z},0).catch(ue),this.model.enableTiles=!0},t.prototype.updateTime=function(e,t){if(!this.destroyed){var n={},r={};this.locationMotion.ended||(this.locationMotion.update(e),n.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,r.distance=this.locationMotion.value.distance,r.offset=new i.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),Xr(n)||this.model.setMaterial(n),Xr(r)||this.setCamera(r)}},t.prototype.getTargetPose=function(){var e=this.cameraMotion.getKeyFrameSegment(de())[1],t=this.locationMotion.getKeyFrameSegment(de())[1];return{longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:t.value.distance,offset:new i.Vector3(t.value.x,t.value.y,t.value.z)}},t.prototype.initAnimation=function(e,n,r,o){var a=this;return this.destroyed?Promise.resolve():new Promise((function(s){var l,c,u,h,d;a.userAction=o;var p={longitude:null!==(l=n.longitude)&&void 0!==l?l:a.defaultLongitude,latitude:Gt(null!==(c=n.latitude)&&void 0!==c?c:a.defaultLatitude,a.minLatitude,a.maxLatitude),fov:null!==(u=n.fov)&&void 0!==u?u:Ra,offset:null!==(h=n.offset)&&void 0!==h?h:a.model.bounding.getCenter(new i.Vector3),distance:null!==(d=n.distance)&&void 0!==d?d:t.distanceFromModel(a.model,Ra,a.camera.aspect)},f=un(p,["longitude","latitude","fov"]),A={x:p.offset.x,y:p.offset.y,z:p.offset.z,distance:p.distance,modelAlpha:1,perspToOrtho:0,orthoDistance:p.distance};a.emit("initAnimationWillStart",e,p,a.userAction),a.cameraMotion.set(f,r).catch(ue),a.locationMotion.set(A,r).then((function(){a.emit("initAnimationEnded",e,p,a.userAction)}),(function(t){var n=Yr(a.camera.pose);a.emit("initAnimationEnded",e,n,a.userAction)})).then((function(){a.model.enableTiles=!0,s()}))}))},t.prototype.getForwardPanoIndexOrNot=function(e){var t=this.work.observers.filter((function(e){return e.active})),n=this.model.intersectRaycaster(e)[0];if(!n)return null;var i=Wr(t,(function(e){return e.standingPosition.distanceTo(n.point)}),!0),r=i[0];return i[1]<5?this.work.observers.indexOf(r):null},t.prototype.coordinatesForOffset=function(e){var t=this.cameraMotion.value.fov,n=this.camera.aspect,r=this.renderer.getSize(new i.Vector2);return{longitude:2*e.x/(r.x*this.scissor.width)*t/95*n,latitude:-2*e.y/(r.y*this.scissor.height)*t/95}},t.prototype.onPanGesture=function(e){var n=this.panState,r=e.pointers.length;if(e.isFinal)delete this.panState;else{var o=void 0;if(e.pointerType)switch(e.srcEvent.buttons){case 0:o=void 0;break;case 1:o="left";break;case 2:o="right"}this.panState={mouseState:o,pointerLength:r,x:e.center.x,y:e.center.y}}if(void 0!==n&&n.pointerLength===r){var a=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pan",a,e.isFinal))if("mouse"===e.pointerType&&2===e.srcEvent.buttons){var s={x:e.center.x-n.x,y:e.center.y-n.y},l=new i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),c=(b=this.model.bounding).getCenter(new i.Vector3),u={x:(b.max.x-b.min.x)/Ra*this.cameraMotion.value.fov,y:(b.max.y-b.min.y)/Ra*this.cameraMotion.value.fov,z:(b.max.z-b.min.z)/Ra*this.cameraMotion.value.fov},h=(this.camera.position.y-b.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),d=this.renderer.getSize(new i.Vector2);l.add(La(4*s.x*h/d.y,this.camera.matrix)),l.add(Oa(4*s.y*h/d.y)),l.x=Gt(l.x,c.x-u.x,c.x+u.x),l.y=Gt(l.y,c.y-u.y,c.y+u.y);var p={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:l,distance:this.locationMotion.value.distance};if(this.emit("wantsPanGesture",p,e.isFinal))return;this.emit("gesture","pan",a,e.isFinal),this.emit("panGesture",p,e.isFinal),this.userAction=!0,this.locationMotion.set({x:l.x,y:l.y,z:l.z},0).catch(ue)}else{l={x:e.center.x-n.x,y:e.center.y-n.y};var f=this.relativeClientPosition(e.center),A=this.camera.pose.latitude<Math.PI/6||f.y<0?1:-1;l.x*=A;var v=this.coordinatesForOffset(l),m=Vr(this.cameraMotion.value.longitude+-1*v.longitude),g=Gt(this.cameraMotion.value.latitude+-1*v.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&&(g=this.cameraMotion.value.latitude);p={longitude:m,latitude:g,fov:this.cameraMotion.value.fov,offset:this.camera.pose.offset.clone(),distance:this.camera.pose.distance};if(this.emit("wantsPanGesture",p,e.isFinal))return;this.emit("gesture","pan",a,e.isFinal),this.emit("panGesture",p,e.isFinal),this.userAction=!0,this.interiaMovement=!1;var y={longitude:p.longitude,latitude:p.latitude,fov:p.fov};if(this.cameraMotion.set(y,0).catch(ue),e.isFinal&&"right"===n.mouseState){var b=this.model.bounding,x=Math.pow(Math.pow((b.max.x-b.min.x)/2,2)+Math.pow((b.max.y-b.min.y)/2,2)+Math.pow((b.max.z-b.min.z)/2,2),.5);console.log(x);var w=new i.Vector3;this.model.bounding.getCenter(w);var M=w.sub(this.camera.position).length();if(M<=x){var C=t.distanceFromModel(this.model,this.cameraMotion.value.fov,this.camera.aspect),E=Gt((0*x-C)/(.5*x)*(x-M)+C,0*x,this.maxDistance);this.camera.computePose(E);var I=this.camera.pose.offset;this.locationMotion.set({distance:E,x:I.x,y:I.y,z:I.z},0),this.emit("cameraUpdate",this.camera.pose,!0)}}if(e.isFinal)if(!this.emit("wantsInteriaPan",p)){this.interiaMovement=!0;var S=e.velocityX*-A,B=-1*e.velocityY;this.requestInteriaMovement(this.coordinatesForOffset({x:S,y:B}),0)}}}},t.prototype.onPinchGesture=function(e){var t=this.pinchState||{},n=t.distance;t.offsetY;var r=!1;if("pinchstart"!==e.type){if("pinchend"===e.type&&(r=!0,delete this.pinchState),void 0!==n){this.pinchState={distance:n};var o=e.pointers.map((function(e){return un(e,["x","y"])}));if(this.emit("wantsGesture","pinch",o,r))return;var a=Gt(n/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(ue)}var s=this.panState,l=e.pointers.length;if(e.isFinal?delete this.panState:this.panState={mouseState:void 0,pointerLength:l,x:e.center.x,y:e.center.y},void 0!==s&&s.pointerLength===l){var c=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",c,r)){var u=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","pinch",u,r)){var h={x:e.center.x-s.x,y:e.center.y-s.y},d=new i.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=this.model.bounding,f=p.getCenter(new i.Vector3),A={x:(p.max.x-p.min.x)/Ra*this.cameraMotion.value.fov,y:(p.max.y-p.min.y)/Ra*this.cameraMotion.value.fov,z:(p.max.z-p.min.z)/Ra*this.cameraMotion.value.fov},v=(this.camera.position.y-p.min.y)*Math.tan(this.camera.fov/2*Math.PI/180),m=this.renderer.getSize(new i.Vector2);d.add(La(2*h.x*v/m.y,this.camera.matrix)),d.add(Oa(2*h.y*v/m.y)),d.x=Gt(d.x,f.x-A.x,f.x+A.x),d.y=Gt(d.y,f.y-A.y,f.y+A.y);var g={longitude:0,latitude:Math.PI/2,fov:this.cameraMotion.value.fov,offset:d,distance:this.locationMotion.value.distance};this.emit("wantsPanGesture",g,e.isFinal)||(this.emit("gesture","pan",u,e.isFinal),this.emit("panGesture",g,e.isFinal),this.userAction=!0,this.locationMotion.set({x:d.x,y:d.y,z:d.z},0).catch(ue))}}}}else this.pinchState={distance:this.locationMotion.value.distance}},t.prototype.onMouseWheel=function(e){var t=this,n=(Math.abs(e.deltaY)>Math.abs(e.deltaX)?e.deltaY:e.deltaX)/-60,i=[{x:e.clientX,y:e.clientY,delta:n}];if(!this.emit("wantsGesture","mouseWheel",i,!1)){var r=Gt(this.locationMotion.value.distance-n/2,this.minDistance,this.maxDistance);console.log(r,this.maxDistance),this.emit("wantsMouseWheel",n,this.camera.pose.fov,!1)||(this.emit("gesture","mouseWheel",i,!1),this.emit("mouseWheel",n,this.camera.pose.fov,!1),this.userAction=!0,this.locationMotion.set({distance:r},0).catch(ue),this.mouseWheelState&&clearTimeout(this.mouseWheelState.timer),this.mouseWheelState={timer:window.setTimeout((function(){delete t.mouseWheelState;t.emit("wantsGesture","mouseWheel",i,!0)||t.emit("wantsMouseWheel",n,t.camera.pose.fov,!0)||(t.emit("gesture","mouseWheel",i,!0),t.emit("mouseWheel",0,t.camera.pose.fov,!0))}),200)})}},t.prototype.onTapGesture=function(e){var t=e.pointers.map((function(e){return un(e,["x","y"])}));if(!this.emit("wantsGesture","tap",t,!0)){var n=this.relativeClientPosition(e.center),r=new i.Raycaster;if(r.setFromCamera(n,this.camera),!this.emit("wantsTapGesture",r,n,!0)){this.emit("gesture","tap",t,!0),this.emit("tapGesture",r,n,!0),this.interiaMovement=!1;var o=this.getForwardPanoIndexOrNot(r);if(!Ki(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 n,r,o=[e];if(this.emit("wantsGesture","press",o,t))return null===(n=this.pressState)||void 0===n||n.stop(),void delete this.pressState;var a=this.relativeClientPosition(e),s=new i.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.requestInteriaMovement=function(e,t){var n=this;if(!1!==this.interiaMovement){for(var i=re({},e),r={longitude:0,latitude:0},o=0;o<t;o++)i.longitude*=.996,i.latitude*=.994008,r.longitude+=i.longitude,r.latitude+=i.latitude;var a=Vr(this.cameraMotion.value.longitude+r.longitude),s=Gt(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(ue);var c=i.longitude>1e-4||i.longitude<-1e-4||i.latitude>1e-4||i.latitude<-1e-4;this.emit("interiaPan",l,!c),c?Fe.shared.add((function(e,t){n.requestInteriaMovement(i,0|t)}),!0,1):this.interiaMovement=!1}},t}(so),ka={type:"move"},Da=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 i.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 i.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new i.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new i.Vector3),this._targetRay},e.prototype.getGripSpace=function(){return null===this._grip&&(this._grip=new i.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new i.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new i.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,n){var r=null,o=null,a=null,s=this._targetRay,l=this._grip,c=this._hand;if(e&&e.gamepad&&e.gamepad.axes&&(this._axes=[e.gamepad.axes[2],e.gamepad.axes[3]]),e&&"visible-blurred"!==t.session.visibilityState)if(null!==s&&null!==(r=t.getPose(e.targetRaySpace,n))&&(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(ka)),c&&e.hand){a=!0;for(var u=0,h=e.hand.values();u<h.length;u++){var d=h[u],p=t.getJointPose(d,n);if(void 0===c.joints[d.jointName]){var f=new i.Group;f.matrixAutoUpdate=!1,f.visible=!1,c.joints[d.jointName]=f,c.add(f)}var A=c.joints[d.jointName];null!==p&&(A.matrix.fromArray(p.transform.matrix),A.matrix.decompose(A.position,A.rotation,A.scale),A.jointRadius=p.radius),A.visible=null!==p}var v=c.joints["index-finger-tip"],m=c.joints["thumb-tip"],g=v.position.distanceTo(m.position);c.inputState.pinching&&g>.025?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&g<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&null!==(o=t.getPose(e.gripSpace,n))&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1);return null!==s&&(s.visible=null!==r),null!==l&&(l.visible=null!==o),null!==c&&(c.visible=null!==a),this},e}(),Qa=function(e){function t(t,n,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=n,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 Da,new Da],l.inputSourcesMap=new Map,l.cameraVR=new i.ArrayCamera,l.cameraL=new i.PerspectiveCamera,l.cameraR=new i.PerspectiveCamera,l.cameraL.viewport=new i.Vector4,l.cameraR.viewport=new i.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 i.Vector3,l.cameraRPos=new i.Vector3,l}return ie(t,e),t.prototype.getController=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getTargetRaySpace()},t.prototype.getControllerGrip=function(e){var t=this.controllers[e];return t||console.warn("no controller find"),t.getGripSpace()},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,n){this.cameraLPos.setFromMatrixPosition(t.matrixWorld),this.cameraRPos.setFromMatrixPosition(n.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),r=t.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(o[8]+1)/o[0],d=a*u,p=a*h,f=i/(-u+h),A=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(A),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var v=a+f,m=s+f,g=d-A,y=p+(i-A),b=l*s/m*v,x=c*s/m*v;e.projectionMatrix.makePerspective(g,y,b,x,v,m)},t.prototype.getCamera=function(e){this.cameraVR.near=this.cameraR.near=this.cameraL.near=e.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=e.far,!this.session||this.currentDepthNear===this.cameraVR.near&&this.currentDepthFar===this.cameraVR.far||(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var t=e.parent,n=this.cameraVR.cameras;this.updateCamera(this.cameraVR,t);for(var i=0;i<n.length;i++)this.updateCamera(n[i],t);e.matrixWorld.copy(this.cameraVR.matrixWorld);for(var r=e.children,o=(i=0,r.length);i<o;i++)r[i].updateMatrixWorld(!0);return 2===n.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,n=0;n<this.controllers.length;n++)this.inputSourcesMap.set(t[n],this.controllers[n]);for(n=0;n<e.removed.length;n++){var i=e.removed[n];(r=this.inputSourcesMap.get(i))&&(r.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(n=0;n<e.added.length;n++){var r;i=e.added[n];(r=this.inputSourcesMap.get(i))&&r.dispatchEvent({type:"connected",data:i})}}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,Fe.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 n=this.gl.getContextAttributes();this.gl.makeXRCompatible().then((function(){var e={antialias:null==n?void 0:n.antialias,alpha:null==n?void 0:n.alpha,depth:null==n?void 0:n.depth,stencil:null==n?void 0:n.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}(ce),Na=["webXRSessionStart","webXRSessionEnd"],Va=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 i.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 i.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2)),t}return ie(t,e),t.prototype.applyMatrix4=function(e){var t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.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 n=new i.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new i.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new i.InterleavedBufferAttribute(n,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 n=new i.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceColorStart",new i.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new i.InterleavedBufferAttribute(n,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 i.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var t=e.geometry;if(t instanceof i.Geometry){var n=(new i.BufferGeometry).fromGeometry(t);this.setPositions(n.attributes.position.array)}else t instanceof i.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new i.Box3);var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var n=new i.Box3;this.boundingBox.setFromBufferAttribute(e),n.setFromBufferAttribute(t),this.boundingBox.union(n)}},t.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new i.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var r=0,o=new i.Vector3,a=0,s=e.count;a<s;a++)o.fromBufferAttribute(e,a),r=Math.max(r,n.distanceToSquared(o)),o.fromBufferAttribute(t,a),r=Math.max(r,n.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}(i.InstancedBufferGeometry);Object.assign(Va.prototype,{isLineSegmentsGeometry:!0});var Ua={uniforms:i.UniformsUtils.merge([i.UniformsLib.common,i.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new i.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"},za=function(e){function t(t){var n=e.call(this,{uniforms:i.UniformsUtils.clone(Ua.uniforms),vertexShader:Ua.vertexShader,fragmentShader:Ua.fragmentShader,clipping:!0})||this;return n.type="LineMaterial",n.dashed=!1,Object.defineProperties(n,{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)}}}),n.setValues(t),n}return ie(t,e),t}(i.ShaderMaterial);Object.assign(za.prototype,{isLineMaterial:!0});var qa=function(e){function t(t,n){var i=e.call(this)||this;return i.type="LineSegments2",i.geometry=void 0!==t?t:new Va,i.material=void 0!==n?n:new za({color:16777215*Math.random()}),i}return ie(t,e),t.prototype.computeLineDistances=function(){for(var e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count),o=new i.Vector3,a=new i.Vector3,s=0,l=0,c=t.count;s<c;s++,l+=2)o.fromBufferAttribute(t,s),a.fromBufferAttribute(n,s),r[l]=0===l?0:r[l-1],r[l+1]=r[l]+o.distanceTo(a);var u=new i.InstancedInterleavedBuffer(r,2,1);return e.setAttribute("instanceDistanceStart",new i.InterleavedBufferAttribute(u,1,0)),e.setAttribute("instanceDistanceEnd",new i.InterleavedBufferAttribute(u,1,1)),this},t.prototype.raycast=function(e,t){null===e.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var n=e.ray,r=e.camera,o=r.projectionMatrix,a=this.geometry,s=this.material,l=s.resolution,c=s.linewidth,u=a.attributes.instanceStart,h=a.attributes.instanceEnd,d=new i.Vector4,p=new i.Vector4,f=new i.Vector4,A=new i.Vector3,v=new i.Matrix4,m=new i.Line3,g=new i.Vector3;n.at(1,f),f.w=1,f.applyMatrix4(r.matrixWorldInverse),f.applyMatrix4(o),f.multiplyScalar(1/f.w),f.x*=l.x/2,f.y*=l.y/2,f.z=0,A.copy(f);var y=this.matrixWorld;v.multiplyMatrices(r.matrixWorldInverse,y);for(var b=0,x=u.count;b<x;b++){d.fromBufferAttribute(u,b),p.fromBufferAttribute(h,b),d.w=1,p.w=1,d.applyMatrix4(v),p.applyMatrix4(v),d.applyMatrix4(o),p.applyMatrix4(o),d.multiplyScalar(1/d.w),p.multiplyScalar(1/p.w);var w=d.z<-1&&p.z<-1,M=d.z>1&&p.z>1;if(!w&&!M){d.x*=l.x/2,d.y*=l.y/2,p.x*=l.x/2,p.y*=l.y/2,m.start.copy(d),m.start.z=0,m.end.copy(p),m.end.z=0;var C=m.closestPointToPointParameter(A,!0);m.at(C,g);var E=i.MathUtils.lerp(d.z,p.z,C),I=E>=-1&&E<=1,S=A.distanceTo(g)<.5*c;if(I&&S){m.start.fromBufferAttribute(u,b),m.end.fromBufferAttribute(h,b),m.start.applyMatrix4(y),m.end.applyMatrix4(y);var B=new i.Vector3,T=new i.Vector3;n.distanceSqToSegment(m.start,m.end,T,B),t.push({point:T,pointOnLine:B,distance:n.origin.distanceTo(T),object:this,faceIndex:b})}}}},t}(i.Mesh);Object.assign(qa.prototype,{isLineSegments2:!0});var Ha=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.type="Line2",i}return ie(t,e),t}(qa);Object.assign(Ha.prototype,{isLine2:!0});var _a=function(e){function t(){var t=e.call(this)||this;return t.type="LineGeometry",t}return ie(t,e),t.prototype.setPositions=function(t){for(var n=t.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return e.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(t){for(var n=t.length-3,i=new Float32Array(2*n),r=0;r<n;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return e.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var t=e.geometry;if(t instanceof i.Geometry){var n=(new i.BufferGeometry).fromGeometry(t);this.setPositions(n.attributes.position.array)}else t instanceof i.BufferGeometry&&this.setPositions(t.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Va);Object.assign(_a.prototype,{isLineGeometry:!0});var ja=14467195,Ka=null,Ga=function(e){function t(t,n){void 0===t&&(t=new i.Vector3),void 0===n&&(n=new i.Vector3);var r=e.call(this)||this;r.type="FiveLine",r.needsRender=!0;var o=new _a,a=new za({color:ja,linewidth:2,dashScale:20,dashed:!1});r.line=new Ha(o,a);var s=new i.BufferGeometry,l=new i.PointsMaterial({color:ja,size:8,map:Ka||(Ka=(new i.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 i.Points(s,l),r.points.renderOrder=11,r.points.frustumCulled=!1,r.setPoints(t,n),r.add(r.line,r.points),r}return ie(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.210"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,t){var n=[].concat(e.toArray(),t.toArray());this.points.geometry.setAttribute("position",new i.BufferAttribute(new Float32Array(n),3)),this.line.geometry.setPositions(n),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new i.Vector3(e[0],e[1],e[2]),new i.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var t=this.line.material;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];"dashed"===n?(t.dashed=i,i?t.defines.USE_DASH="":delete t.defines.USE_DASH,t.needsUpdate=!0):t[n]=e[n]}this.needsRender=!0},t.prototype.setResolution=function(e,t){var n=this.line.material.resolution;n.x===e&&n.y===t||(n.set(e,t),this.needsRender=!0)},t}(i.Object3D);Object.assign(Ga.prototype,{isFiveLine:!0});const Wa={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function Xa(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function Ya(e,t,n=null,i=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const r=await async function(e){if(!e)throw new Error("No basePath supplied");return await Xa(`${e}/profilesList.json`)}(t);let o;if(e.profiles.some((e=>{const n=r[e];return n&&(o={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!o})),!o){if(!n)throw new Error("No matching profile name found");const e=r[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);o={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const a=await Xa(o.profilePath);let s;if(i){let t;if(t="any"===e.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${o.profileId}`);t.assetPath&&(s=o.profilePath.replace("profile.json",t.assetPath))}return{profile:a,assetPath:s}}const Za={xAxis:0,yAxis:0,button:0,state:Wa.ComponentState.DEFAULT};class Ja{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===Wa.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(Za)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:i}){const{normalizedXAxis:r,normalizedYAxis:o}=function(e=0,t=0){let n=e,i=t;if(Math.sqrt(e*e+t*t)>1){const r=Math.atan2(t,e);n=Math.cos(r),i=Math.sin(r)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*i+.5}}(e,t);switch(this.componentProperty){case Wa.ComponentProperty.X_AXIS:this.value=this.states.includes(i)?r:.5;break;case Wa.ComponentProperty.Y_AXIS:this.value=this.states.includes(i)?o:.5;break;case Wa.ComponentProperty.BUTTON:this.value=this.states.includes(i)?n:0;break;case Wa.ComponentProperty.STATE:this.valueNodeProperty===Wa.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(i):this.value=this.states.includes(i)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class $a{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new Ja(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:Wa.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=Wa.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=Wa.ComponentState.PRESSED:(t.touched||this.values.button>Wa.ButtonTouchThreshold)&&(this.values.state=Wa.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===Wa.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Wa.AxisTouchThreshold&&(this.values.state=Wa.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===Wa.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Wa.AxisTouchThreshold&&(this.values.state=Wa.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class es{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new $a(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}class ts extends e.Object3D{constructor(){super(),this.motionController=null,this.envMap=null}setEnvironmentMap(e){return this.envMap==e||(this.envMap=e,this.traverse((e=>{e.isMesh&&(e.material.envMap=this.envMap,e.material.needsUpdate=!0)}))),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach((e=>{Object.values(e.visualResponses).forEach((e=>{const{valueNode:t,minNode:n,maxNode:i,value:r,valueNodeProperty:o}=e;t&&(o===Wa.VisualResponseProperty.VISIBILITY?t.visible=r:o===Wa.VisualResponseProperty.TRANSFORM&&(t.quaternion.copy(n.quaternion).slerp(i.quaternion,r),t.position.lerpVectors(n.position,i.position,r)))}))})))}}function ns(t,n){!function(t,n){Object.values(t.components).forEach((t=>{const{type:i,touchPointNodeName:r,visualResponses:o}=t;if(i===Wa.ComponentType.TOUCHPAD)if(t.touchPointNode=n.getObjectByName(r),t.touchPointNode){const n=new e.SphereGeometry(.001),i=new e.MeshBasicMaterial({color:255}),r=new e.Mesh(n,i);t.touchPointNode.add(r)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(o).forEach((e=>{const{valueNodeName:t,minNodeName:i,maxNodeName:r,valueNodeProperty:o}=e;if(o===Wa.VisualResponseProperty.TRANSFORM){if(e.minNode=n.getObjectByName(i),e.maxNode=n.getObjectByName(r),!e.minNode)return void console.warn(`Could not find ${i} in the model`);if(!e.maxNode)return void console.warn(`Could not find ${r} in the model`)}e.valueNode=n.getObjectByName(t),e.valueNode||console.warn(`Could not find ${t} in the model`)}))}))}(t.motionController,n),t.envMap&&n.traverse((e=>{e.isMesh&&(e.material.envMap=t.envMap,e.material.needsUpdate=!0)})),t.add(n)}class is{constructor(e=null){this.gltfLoader=e,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new Qi)}createControllerModel(e){const t=new ts;let n=null;return e.addEventListener("connected",(e=>{const i=e.data;"tracked-pointer"===i.targetRayMode&&i.gamepad&&Ya(i,this.path,"generic-trigger").then((({profile:e,assetPath:r})=>{t.motionController=new es(i,e,r);const o=this._assetCache[t.motionController.assetUrl];if(o)n=o.scene.clone(),ns(t,n);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(t.motionController.assetUrl,(e=>{this._assetCache[t.motionController.assetUrl]=e,n=e.scene.clone(),ns(t,n)}),null,(()=>{throw new Error(`Asset ${t.motionController.assetUrl} missing or malformed.`)}))}})).catch((e=>{console.warn(e)}))})),e.addEventListener("disconnected",(()=>{t.motionController=null,t.remove(n),n=null})),t}}var rs=(new i.Matrix4).makeRotationAxis(new i.Vector3(0,1,0),Math.PI),os=new i.Vector3(-1,1,1),as=function(e){function t(t){var n=e.call(this,t)||this;n.xrManager=new Qa(n.renderer,n.renderer.getContext()),n.xrControllerRay=[new i.Raycaster,new i.Raycaster],n.pointerLines=[new Ga,new Ga],n.pointerLines[0].visible=!1,n.pointerLines.forEach((function(e){e.setMaterial({color:new i.Vector3(1,1,1)}),e.points.material.depthTest=!1})),n.scene.add(n.pointerLines[0],n.pointerLines[1]),n.panoResources={},n.panoResources[n.locationMotion.keyframes[0].key=n.locationMotion.keyframes[1].key=Fi()]={panoIndex:n.currentPanoIndex,workCode:n.work.workCode,leftPanoPicture:null,position:n.camera.pose.offset.clone(),effect:"fade"},n.on("webXRSessionEnd",(function(){n.pointerLines.forEach((function(e){n.scene.remove(e)}))})),n.on("webXRMoveToPano",(function(e){e&&n.checkSelectedPano(e)})),n.parallaxCameraMatrixs=[];var r=Fe.shared.getContext();if(!r)return console.error("获取session失败,请退出重试"),n;n.xrManager.setSession(r),n.controllerWrappers=[new i.Group,new i.Group],n.scene.add(n.controllerWrappers[0],n.controllerWrappers[1]);var o=n.xrManager.getController(0);n.controllerWrappers[0].add(o);var a=n.xrManager.getController(1);n.controllerWrappers[1].add(a);var s=new is,l=n.xrManager.getControllerGrip(0);l.add(s.createControllerModel(l)),n.controllerWrappers[0].add(l);var c=n.xrManager.getControllerGrip(1);c.add(s.createControllerModel(c)),n.controllerWrappers[1].add(c);for(var u=function(e){h.xrManager.on(e,(function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];n.emit.apply(n,oe([e],t,!1))}))},h=this,d=0,p=Na;d<p.length;d++){u(p[d])}return n.xrControllerState={LeftAxesUp:{touchStartTime:0,touchStart:!1},LeftAxesDown:{touchStartTime:0,touchStart:!1},LeftAxesLeft:{touchStartTime:0,touchStart:!1},LeftAxesRight:{touchStartTime:0,touchStart:!1},LeftTrigger:{touchStartTime:0,touchStart:!1},LeftPinch:{touchStartTime:0,touchStart:!1},RightAxesUp:{touchStartTime:0,touchStart:!1},RightAxesDown:{touchStartTime:0,touchStart:!1},RightAxesLeft:{touchStartTime:0,touchStart:!1},RightAxesRight:{touchStartTime:0,touchStart:!1},RightTrigger:{touchStartTime:0,touchStart:!1},RightPinch:{touchStartTime:0,touchStart:!1},Y:{touchStartTime:0,touchStart:!1},X:{touchStartTime:0,touchStart:!1},A:{touchStartTime:0,touchStart:!1},B:{touchStartTime:0,touchStart:!1}},n}return ie(t,e),t.parseArgs=function(t){var n=re(re({},t),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return e.parseArgs.call(this,n)},t.initAnimationEndPose=function(t){var n=this.parseArgs(t);return e.initAnimationEndPose.call(this,n)},t.prototype.moveToPano=function(e,t,n){var r,o,a,s,l=this;this.userAction=n;var c=this.work.observers[e],u=this.imageOptions.size;if(void 0===u&&c){var h=c.images.up.match(/\/cube_(\d+)\//);h&&(u=Number(h[1]))}void 0===u&&(u=2048);var d=this.imageOptions.transform,p=function(e,t){return function(e,t){if(!t)return e;var n=e.match(/\d+_[a-z].png/);return e.substring(0,n.index)+t+"/"+e.substring(n.index)}(ze(e,d,t))},f=re({key:"pano.".concat(e)},un(this.imageOptions,["format","size","quality"])),A=c.images,v=null!==(o=null===(r=c.images.tiles)||void 0===r?void 0:r.filter((function(e){return e.size>u})))&&void 0!==o?o:null,m="pano:"+dn([A,f,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===m)return;var g=this.pendingTextureTask.panoIndex;null===(a=this.panoMeshes[g])||void 0===a||a.setProgress(0),this.emit("textureAbort",g,c),this.pendingTextureTask.onError(new Error("texture aborted"))}var y,b=this.model.getMaterial()||{},x=b.pano0,w=b.pano1;if((null==x?void 0:x.map.name)===m?y=x:(null==w?void 0:w.map.name)===m&&(y=w),y){var M={panoIndex:e,workCode:this.work.workCode,effect:null!==(s=t.effect)&&void 0!==s?s:"fade",leftPanoPicture:{map:y.map,luminanceMap:y.luminanceMap,matrix:(new i.Matrix4).compose(c.position,c.quaternion,os)},position:c.position.clone()};this.doMoveToPano(e,M,t)}else{var C="move-to-pano-"+e;this.pending.add(C),this.pendingTextureTask={panoIndex:e,hash:m,onLoad:function(n){var r;if(l.pending.delete(C),l.destroyed)n.body.dispose();else{n.body.name=m;var o={panoIndex:e,workCode:l.work.workCode,effect:null!==(r=t.effect)&&void 0!==r?r:"fade",leftPanoPicture:{map:n.body,luminanceMap:null,matrix:(new i.Matrix4).compose(c.position,c.quaternion,os)},position:c.position.clone()};l.doMoveToPano(e,o,t)}},onError:function(n){l.pending.delete(C),t.moveCancelCallback&&t.moveCancelCallback(),l.emit("panoLoadError",n,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:i.RGBAFormat,viaAjax:!0},void 0,void 0,(function(t){var n,i;l.emit("textureLoading",t,e,c),(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===m&&(null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(t))}),this.renderer):this.textureLoader.loadCubeTexture(A,{imageURL:{transform:p,options:f},format:i.RGBAFormat},void 0,void 0,(function(t){var n,i;(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===m&&(null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(t)),l.emit("textureLoading",t,e,c)}),this.renderer)]).then((function(t){var n,i,r=t[0];(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===m?(l.pendingTextureTask.onLoad(r),null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(0),delete l.pendingTextureTask,l.emit("textureLoaded",e,c,r.meta)):r.body.dispose()})).catch((function(t){var n,i;(null===(n=l.pendingTextureTask)||void 0===n?void 0:n.hash)===m&&(l.pendingTextureTask.onError(t),null===(i=l.panoMeshes[e])||void 0===i||i.setProgress(0),delete l.pendingTextureTask,l.emit("textureError",t,e,c),l.emit("error",t))})),this.emit("textureStartLoad",e,c)}},t.prototype.doMoveToPano=function(e,t,n){var r,o,a,s=this;void 0===n&&(n={});var l=de(),c=Fi();this.panoResources[c]=t;var u,h,d;if(this.locationMotion.ended){var p=this.locationMotion.getKeyFrameSegment(l);p[0];var f=p[1],A=this.locationMotion.value,v=this.panoResourceFromLocationMotionKeyframe(f).position,m=t.position;u=Math.max(v.distanceTo(m),1),h=[{key:f.key,progress:0,value:re(re({},A),{count:0})},{key:c,progress:1,value:{distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0,count:1}}],d=0}else{var g=this.locationMotion.getKeyFrameSegment(l),y=g[0],b=(f=g[1],A=this.locationMotion.value,this.panoResourceFromLocationMotionKeyframe(y).position),x=(v=this.panoResourceFromLocationMotionKeyframe(f).position,m=t.position,f.value.count-A.count),w=Math.max(b.distanceTo(v),1)*x;u=w+Math.max(v.distanceTo(m),1),h=[{key:y.key,progress:0,value:re({},A)},{key:f.key,progress:w/u,value:f.value},{key:c,progress:1,value:{count:f.value.count+1,distance:0,perspToOrtho:0,orthoDistance:1,modelAlpha:0}}];var M=this.locationMotionKeyframesLength(this.locationMotion.keyframes),C=this.locationMotionKeyframesLength(h);d=this.locationMotion.getProgressVelocity(l)*M/C}var E=this.calculateMovingDuration(n.duration,u),I={longitude:n.longitude,latitude:n.latitude,fov:n.fov},S={longitude:null!==(r=I.longitude)&&void 0!==r?r:this.camera.pose.longitude,latitude:null!==(o=I.latitude)&&void 0!==o?o:this.camera.pose.latitude,fov:null!==(a=I.fov)&&void 0!==a?a:this.camera.pose.fov,offset:t.position.clone(),distance:0};this.emit("moveToPano",e,this.userAction),n.moveStartCallback&&n.moveStartCallback(e,S),this.emit("panoWillArrive",e,S,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=ue,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),this.cameraMotion.set(I,E).catch(ue),this.locationMotion.setKeyframes(h,E,d).then((function(){var t,r,o,a={longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0};n.moveEndCallback&&n.moveEndCallback(e,a),s.emit("panoArrived",e,a,s.userAction);var l=s.work.observers[s.currentPanoIndex];if(l&&l.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var c=rs.clone().multiply(null!==(o=null===(r=null===(t=s.model.getMaterial())||void 0===t?void 0:t.pano1)||void 0===r?void 0:r.matrix)&&void 0!==o?o:new i.Matrix4).multiply(l.video.matrix),u={map:s.videoTexture,size:l.video.size,matrix:c,alpha:1},h=Fi(),d=s.videoTexture.image;d.setAttribute("uuid",h),go().then((function(e){e&&l.video&&d.getAttribute("uuid")===h&&(d.oncanplay=function(){d.oncanplay=ue,d.play()},d.ontimeupdate=function(){d.currentTime>.5&&(d.ontimeupdate=ue,s.panoVideo.setMaterial(u))},d.src=l.video.source)})).catch((function(){d.removeAttribute("uuid")}))}}),(function(){n.moveCancelCallback&&n.moveCancelCallback(),s.emit("moveToPanoCanceled",e)}))},t.prototype.checkSelectedPano=function(e){var t=this;this.interiaMovement=!1;var n=this.camera.getDirection(new i.Vector3).setY(0),r=null,o=this.work.observers[this.currentPanoIndex];if(!o)return r;var a=o.accessibleNodes.filter((function(e){if(e===t.currentPanoIndex)return!1;var n=t.work.observers[e];return!(n.position.distanceTo(t.camera.position)>t.maxAccessibleDistance)&&(n.loadable||n.active)})),s=this.model.intersectRaycaster(e)[0];if(s){var l=Wr(a,(function(e){return t.work.observers[e].standingPosition.clone().distanceTo(s.point)}),!0),c=l[0];l[1]<this.panoTapTriggerRadius&&(r=c)}Ki(r)&&(r=this.getForwardPanoIndexOrNot(e));for(var u=0,h=this.locationMotion.keyframes;u<h.length;u++){var d=h[u],p=this.panoResourceFromLocationMotionKeyframe(d);if(!(d.progress<this.locationMotion.progress)&&p.panoIndex===r){r=null;break}}if(this.emit("panoSelected",r),Ki(r))return!0===this.locationMotion.ended&&this.cameraBounce(),r;var f=this.work.observers[r];if(!f.active)return this.panoMeshes[r]&&(this.panoMeshes[r].setDisabled(!1),this.panoMeshes[r].setLoading(!0)),r;for(var A={effect:"fade"},v=Math.PI/6,m=Math.PI/12,g=new i.Vector3(0,1,0),y=f.position.clone().setY(0).sub(o.position.clone().setY(0)).normalize(),b=y.clone().applyAxisAngle(g,v),x=y.clone().applyAxisAngle(g,-v),w=[],M=[],C=[],E=0,I=f.accessibleNodes;E<I.length;E++){if((c=I[E])!==this.currentPanoIndex&&c!==r){var S=this.work.observers[c].position.clone().sub(f.position).setY(0);y.angleTo(S)<v?C.push(S):b.angleTo(S)<v?w.push(S):x.angleTo(S)<v&&M.push(S)}}var B=(C.length>0?C:oe(oe([],w,!0),M,!0)).slice().sort((function(e,t){return e.angleTo(y)-t.angleTo(y)}))[0];return B&&B.angleTo(n)>m&&(A.longitude=Math.atan2(-B.x,-B.z)),this.cameraMotion.value.latitude<-Math.PI/4&&(A.latitude=Gt(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 n,r,o,a,s,l,c,u=this,h=[],d=2;d<arguments.length;d++)h[d-2]=arguments[d];var p=this.currentPanoIndex,f={},A={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),m=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),g=!1;if(!1===this.locationMotion.ended){this.locationMotion.update(e);var y=this.locationMotion.getKeyFrameSegment(e),b=y[0],x=y[1],w=this.panoResourceFromLocationMotionKeyframe(b),M=this.panoResourceFromLocationMotionKeyframe(x),C=(new i.Vector3).copy(w.position),E=(new i.Vector3).copy(M.position),I=this.locationMotion.value.count-x.value.count+1;f.progress=I,f.modelAlpha=this.locationMotion.value.modelAlpha,this.camera.perspToOrtho.setScalar(Gt(this.locationMotion.value.perspToOrtho,0,1)),this.camera.orthoDistance=this.locationMotion.value.orthoDistance,M.leftPanoPicture&&(I<1?w.leftPanoPicture&&(f.pano0=w.leftPanoPicture):f.pano0=M.leftPanoPicture,f.pano1=M.leftPanoPicture),g=f.useBlackTransition="instant"===M.effect||"montage"===M.effect,"fade"!==M.effect&&"montage"!==M.effect||(f.pano0&&w.leftPanoPicture&&(f.pano0={map:f.pano0.map,luminanceMap:f.pano0.luminanceMap,matrix:w.leftPanoPicture.matrix.clone().setPosition(M.position)}),C.copy(E)),A.distance=this.locationMotion.value.distance,A.offset=new i.Vector3(C.x+(E.x-C.x)*I,C.y+(E.y-C.y)*I,C.z+(E.z-C.z)*I);for(var S=[],B=[],T=0,P=this.locationMotion.keyframes;T<P.length;T++){var R=P[T],L=R.key,O=R.progress;void 0!==L&&(S.push(L),O>=this.locationMotion.progress&&B.push(L))}for(var F=0,k=Object.keys(this.panoResources);F<k.length;F++){var D=k[F];if(!(B.indexOf(D)>=0)){var Q=this.panoResources[D];if(Q.leftPanoPicture){var N=Q.leftPanoPicture.map;if(N){if(N===(null===(n=f.pano0)||void 0===n?void 0:n.map))continue;if(N===(null===(r=f.pano1)||void 0===r?void 0:r.map))continue;N instanceof wt&&N.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(N.cubeRenderTarget),N.dispose(),Q.leftPanoPicture=null}}S.indexOf(D)>=0||delete this.panoResources[D]}}w.workCode===M.workCode?this.currentPanoIndex=I<.5?w.panoIndex:M.panoIndex:this.currentPanoIndex=M.panoIndex,this.emit("movingToPano",m.panoIndex,v.panoIndex,this.locationMotion.progress)}!1===this.cameraMotion.ended&&(this.cameraMotion.update(e),A.longitude=this.cameraMotion.value.longitude,A.latitude=this.cameraMotion.value.latitude,A.fov=this.cameraMotion.value.fov),!1===Xr(f)&&((null===(o=f.pano0)||void 0===o?void 0:o.map)&&f.pano0.map instanceof wt&&!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 wt&&!f.pano1.map.cubeRenderTarget&&(f.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.model.setMaterial(f)),!1===Xr(A)&&this.setCamera(A);var V=h[1];if(V)if(this.xrManager.session){var U=this.xrManager.referenceSpace;if(U){var z=this.xrManager.cameraVR,q=[this.xrManager.cameraL,this.xrManager.cameraR],H=V.getViewerPose(U),_=new i.Vector3(0,0,0);if(H){var j;switch(this.xrManager.machineType){case"Pico":j=this.xrManager.session.renderState.baseLayer;break;case"Oculus":var K=this.xrManager.session.renderState.layers;K&&(j=K[0]);break;default:this.xrManager.machineType}var G=H.views;if(j){this.renderer.setFramebuffer(j.framebuffer);var W=!1;G.length!==z.cameras.length&&(z.cameras.length=0,W=!0),this.parallaxCameraMatrixs=[];var X=new i.Vector3,Y=new i.Vector3;(new i.Matrix4).fromArray(G[0].transform.matrix).decompose(X,new i.Quaternion,new i.Vector3),(new i.Matrix4).fromArray(G[1].transform.matrix).decompose(Y,new i.Quaternion,new i.Vector3),Y.clone().sub(X).normalize();var Z=new i.Vector3,J=new i.Quaternion,$=new i.Vector3;this.camera.matrix.decompose(Z,J,$);for(var ee=0;ee<G.length;ee++){var te=G[ee],ne=j.getViewport(te),ie=q[ee];ie.matrix.fromArray(te.transform.matrix);var re=new i.Vector3,oe=new i.Quaternion,ae=new i.Vector3;ie.matrix.decompose(re,oe,ae),_.copy(Z),ie.position.copy(Z),ie.quaternion.copy(oe),ie.scale.copy(ae),ie.updateMatrix(),ie.projectionMatrix.fromArray(te.projectionMatrix),ie.viewport.set(ne.x,ne.y,ne.width,ne.height),!0===W&&z.cameras.push(ie)}var se=H.views[0].transform.position,le=H.views[1].transform.position;new i.Vector3((se.x+le.x)/2,0,(se.z+le.z)/2);var ce=this.xrManager.session.inputSources;for(ee=0;ee<this.xrManager.controllers.length;ee++){var ue=this.xrManager.controllers[ee],he=ce[ee];ue.update(he,V,U);var de=this.xrManager.getController(ee),pe=new i.Vector3(0,1.2,0),fe=de.position.clone().add(_).sub(pe);this.controllerWrappers[ee].position.copy(new i.Vector3(0,0,0).add(_).sub(pe)),this.xrControllerRay[ee].set(fe,new i.Vector3(0,0,-1).applyEuler(de.rotation));var Ae=this.model.intersectRaycaster(this.xrControllerRay[ee]);if(0===Ae.length&&(Ae=this.xrControllerRay[ee].intersectObject(this.boundingMesh,!0)),Ae.length>=1&&Ae[0].face)if(1===ee){var ve=this.xrControllerRay[ee].intersectObject(this.xrCustomObjectsScene,!0),me=Ae[0].face.normal,ge=me.clone().multiplyScalar(.05),ye=Ae[0].point.clone().add(ge);this.intersectMesh.position.copy(ye);var be=ye.clone().add(ge);if(this.intersectMesh.lookAt(be),Math.abs(me.y)>.99){var xe=this.camera.position.clone().sub(ye);this.intersectMesh.rotation.z=-Math.atan2(xe.z,xe.x)}this.intersectMesh.visible=!0,this.needsRender=!0,this.emit("intersectionOnModelUpdate",Ae[0],this.intersectMesh),ve.length>0?(this.pointerLines[ee].setPoints(fe,ve[0].point),this.pointerLines[ee].points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines[ee].points.visible=!1,this.pointerLines[ee].setPoints(fe,Ae[0].point))}else this.pointerLines[ee].setPoints(fe,Ae[0].point)}if(this.currentPanoIndex!==p&&this.updatePanoMeshesVisible(),this.camera.pose.distance>.1||g){var we=this.work.observers[this.currentPanoIndex];if(we)for(var Me=0,Ce=Be=we.visibleNodes.concat(this.currentPanoIndex);Me<Ce.length;Me++){var Ee=Ce[Me];(Oe=this.panoMeshes[Ee])&&Oe.setOpacity(0)}}else{var Ie=this.work.observers[this.currentPanoIndex];if(Ie){var Se=Wr(Ie.visibleNodes,(function(e){return Ie.standingPosition.distanceTo(u.work.observers[e].standingPosition)}),!0)[1];Se=Gt(Se,2.5,1/0);for(var Be=Ie.visibleNodes.concat(this.currentPanoIndex),Te=this.getForwardPanoIndexOrNot(),Pe=this.camera.getDirection(new i.Vector3),Re=0,Le=Be;Re<Le.length;Re++){Ee=Le[Re];var Oe,Fe=this.work.observers[Ee];if(Oe=this.panoMeshes[Ee])if(Fe.loadable||Fe.active){var ke=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&0===Oe.progress&&Te===Ee),Oe.setOpacity(ke<.01?0:Gt(Se/ke*1.2,.65,.98));var De=this.camera.position.clone().setY(Oe.position.y),Qe=(new i.Vector3).copy(Oe.position).sub(De).normalize();if(Ee===this.currentPanoIndex){var Ne=Gt((.5-De.distanceTo(Oe.position))/.5,0,1);Qe.multiplyScalar(1-Ne).add(Pe.clone().multiplyScalar(Ne))}Qe.length()>0&&Oe.quaternion.setFromEuler(new i.Euler(0,Math.atan2(Qe.x,Qe.z),0)),Oe.updateTime&&Oe.updateTime(e,t)}else Oe.setOpacity(0)}}}var Ve,Ue=((Ve=new i.PerspectiveCamera).applyMatrix4(z.matrix),Ve.position.set(0,0,0),Ve.quaternion.premultiply(u.work.observers[m.panoIndex].quaternion.clone().inverse()),Ve.updateProjectionMatrix(),Ve.updateMatrixWorld(!0),(new i.Frustum).setFromProjectionMatrix((new i.Matrix4).multiplyMatrices(Ve.projectionMatrix,Ve.matrixWorldInverse)));m.panoIndex===this.currentPanoIndex&&(null===(s=m.leftPanoPicture)||void 0===s?void 0:s.map)instanceof wt&&(m.leftPanoPicture.map.update(Ue,3),!0===m.leftPanoPicture.map.needsRender&&(this.needsRender=!0));var ze=this.tiling.object.visible;if(3>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var qe=m.panoIndex,He=this.work.observers[qe];He&&Or(this.camera.position,He.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoIndex!==qe&&this.tiling.cleanup(),this.tiling.panoIndex=qe,this.tiling.setResource(null!==(c=null===(l=He.images)||void 0===l?void 0:l.tiles)&&void 0!==c?c:[],this.enableIOSEDR&&He.images.luminance?He.images.luminance:null),this.tiling.setRotation(He.quaternion),this.tiling.setPosition(He.position),this.tiling.update(Ue,3,e)):this.tiling.object.visible=!1}else this.tiling.object.visible=!1;ze!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0),this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.updateControllerHelper(ce,e,t)}else console.error("no layer found")}}}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.prototype.updateControllerHelper=function(e,t,n){if(e&&2===e.length&&e[0].gamepad&&e[1].gamepad){for(var i=0;i<e.length;i++){var r=e[i].handedness,o=e[i].gamepad;switch(r){case"left":this.emit("webXRAxesUpdate","left",{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]},axesState:{up:o.axes[3]<0?Math.abs(o.axes[3]):0,down:o.axes[3]<0?0:Math.abs(o.axes[3]),left:o.axes[2]<0?Math.abs(o.axes[2]):0,right:o.axes[2]<0?0:Math.abs(o.axes[2])},deltaTime:n}),this.bindEventByKey(-1===o.axes[2],"LeftAxesLeft",t),this.bindEventByKey(1===o.axes[2],"LeftAxesRight",t),this.bindEventByKey(-1===o.axes[3],"LeftAxesUp",t),this.bindEventByKey(1===o.axes[3],"LeftAxesDown",t),this.bindEventByKey(null==o?void 0:o.buttons[4].pressed,"X",t),this.bindEventByKey(o.buttons[5].pressed,"Y",t),this.bindEventByKey(null==o?void 0:o.buttons[0].pressed,"LeftTrigger",t),this.bindEventByKey(null==o?void 0:o.buttons[1].pressed,"LeftPinch",t);break;case"right":this.emit("webXRAxesUpdate","right",{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]},axesState:{up:o.axes[3]<0?Math.abs(o.axes[3]):0,down:o.axes[3]<0?0:Math.abs(o.axes[3]),left:o.axes[2]<0?Math.abs(o.axes[2]):0,right:o.axes[2]<0?0:Math.abs(o.axes[2])},deltaTime:n}),this.bindEventByKey(-1===o.axes[2],"RightAxesLeft",t),this.bindEventByKey(1===o.axes[2],"RightAxesRight",t),this.bindEventByKey(-1===o.axes[3],"RightAxesUp",t),this.bindEventByKey(1===o.axes[3],"RightAxesDown",t),this.bindEventByKey(null==o?void 0:o.buttons[4].pressed,"A",t),this.bindEventByKey(o.buttons[5].pressed,"B",t),this.bindEventByKey(null==o?void 0:o.buttons[0].pressed,"RightTrigger",t),this.bindEventByKey(null==o?void 0:o.buttons[1].pressed,"RightPinch",t)}}this.emit("webXRControllerRayUpdate",{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]})}},t.prototype.bindEventByKey=function(e,t,n){if(e)!1===this.xrControllerState[t].touchStart?(this.xrControllerState[t].touchStartTime=n,this.xrControllerState[t].touchStart=!0,this.emit("webXRControllerEvent","buttonDown",t,{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]}})):n-this.xrControllerState[t].touchStartTime>300&&this.emit("webXRControllerEvent","press",t,{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]}});else if(!0===this.xrControllerState[t].touchStart){if(this.emit("webXRControllerEvent","buttonUp",t,{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]}}),n-this.xrControllerState[t].touchStartTime<=300)this.emit("webXRControllerEvent","tap",t,{raycaster:{leftRay:this.xrControllerRay[0],rightRay:this.xrControllerRay[1]}})||"RightTrigger"===t&&this.checkSelectedPano(this.xrControllerRay[1]);this.xrControllerState[t].touchStart=!1,this.xrControllerState[t].touchStartTime=0}},t}(qo),ss=["Panorama","DepthPanorama","Model"],ls={Floorplan:lo,Topview:vo,Panorama:qo,VRPanorama:wa,Model:Ma,DepthPanorama:Pa,Mapview:Fa,XRPanorama:as};function cs(e){for(var t=0,n=ss;t<n.length;t++){var i=n[t];if("string"==typeof e){if(i===e)return!0}else if(e instanceof so&&e instanceof ls[i])return!0}return!1}var us=["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","webXRControllerEvent","webXRControllerRayUpdate","webXRAxesUpdate","webXRMoveToPano"];function hs(e){for(var t,n,i={},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===(n=a[1])||void 0===n?void 0:n.trim();s&&l&&(i[s]=l)}return i}function ds(){for(var e,t=document.getElementsByTagName("meta"),n=0;n<t.length;n++){var i=t[n];if("viewport"===i.getAttribute("name")){var r=hs(null!==(e=i.getAttribute("content"))&&void 0!==e?e:""),o=Number(r["initial-scale"]);if(!isNaN(o))return o}}return 1}var ps=[351,63],fs=[20,20],As=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),vs=new Float32Array([0,0,1,0,0,1,1,1]),ms=new Uint8Array([0,1,2,1,3,2]),gs=new i.BufferGeometry;gs.setAttribute("position",new i.BufferAttribute(As,3)),gs.setAttribute("uv",new i.BufferAttribute(vs,2)),gs.setIndex(new i.BufferAttribute(ms,1));var ys=new i.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),bs=new i.Mesh(gs,ys);bs.matrixAutoUpdate=!1;var xs=new i.Scene;xs.add(bs),xs.matrixAutoUpdate=!1;var ws=new i.OrthographicCamera(-.5,.5,.5,-.5,.1,1);ws.position.set(0,0,.5),ws.lookAt(0,0,0),ws.updateMatrixWorld(!0),ws.matrixAutoUpdate=!1;var Ms=new i.Vector4,Cs=new i.Vector4;function Es(e){if(ys.map){var t=e.getViewport(Ms),n=e.getScissor(Cs),r=e.getScissorTest(),o=e.autoClear,a=n.x+fs[0]/3,s=n.y+fs[1]/3,l=ps[0]/3,c=ps[1]/3;e.setViewport(a,s,l,c),e.setScissor(a,s,l,c),e.setScissorTest(!0),e.autoClear=!1,e.render(xs,ws),e.setViewport(t),e.setScissor(n),e.setScissorTest(r),e.autoClear=o}else{var u=new i.Texture,h=new Image;h.onload=function(){u.image=h,u.wrapS=i.ClampToEdgeWrapping,u.wrapT=i.ClampToEdgeWrapping,u.minFilter=i.LinearFilter,u.needsUpdate=!0,u.generateMipmaps=!1,ys.needsUpdate=!0,h.onload=ue},h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocPDjtUWQ6Tq1M2w7gC2EcrMGtWS6xlpGKEDDcb1vUQ25zT4lrC2s0dU4gFPppKkbeIYr7NMpqjStuFg5rNU9epGyt8PXyfX4DE1bKLhR/1XPxwJhp5DAV67T9ZPwFdovhBMIGUYoRBN4wim6S3eoXVEHXdLgmwY0x6BQnO4xPJ0Ar5OVxhQF0L9UslRM4yaQQfQImnBegi8vhY2A1k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new i.Vector3(50,50,50)),Ss=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/")},Bs=new i.Vector2,Ts=new i.Frustum,Ps=new i.Matrix4,Rs=new WeakMap,Ls=new WeakMap,Os=function(e){function t(t){void 0===t&&(t={});var n,r,o,a,s,l,c,u,h,d,p,f=this;if((f=e.call(this)||this).ident=Fi(),Fs.instances[f.ident]=f,f.renderSwitch01=0,f.panoIndex=0,f.needsRender=!1,f.onlyRenderIfNeeds=null===(n=t.onlyRenderIfNeeds)||void 0===n||n,f.imageOptions=re({},null!==(r=t.imageOptions)&&void 0!==r?r:{}),f.textureOptions=re({},null!==(o=t.textureOptions)&&void 0!==o?o:{}),f.modelLodOptions=re({},null!==(a=t.modelLod)&&void 0!==a?a:{}),f.poweredByRealsee=null===(s=t.poweredByRealsee)||void 0===s||s,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:de()},f.modeChangeDuration=null!==(l=t.modeChangeDuration)&&void 0!==l?l:800,f.panoramaLikeSavedPose={},"undefined"!=typeof window)if(t.renderer)t.renderer instanceof Tt&&f.throwError(new Error("cannot render a internal renderer")),f.renderer=t.renderer;else try{f.renderer=new Tt({preserveDrawingBuffer:t.preserveDrawingBuffer,backgroundColor:t.backgroundColor,backgroundAlpha:t.backgroundAlpha,antialias:t.antialias,webgl2:null==t?void 0:t.webgl2});var A=ds();f.renderer.setPixelRatio(1===A?window.devicePixelRatio:1),f.renderer.setSize(512,512)}catch(e){e instanceof Error&&f.throwError(e)}f.copyEffect=new ao(f.renderer),f.getPixelsRenderTarget=new i.WebGLRenderTarget(1,1,{encoding:null!==(u=null===(c=f.renderer)||void 0===c?void 0:c.outputEncoding)&&void 0!==u?u:i.sRGBEncoding}),f.scissor=Object.assign({left:0,bottom:0,width:1,height:1},t.scissor),f.camera=new Vt(80),f.scene=new Pt,f.xrCustomObjectsScene=new Pt,f.scene.add(f.xrCustomObjectsScene),f.lastLoadWorkTask=Promise.resolve(),f.requestProxy=null!==(h=t.requestProxy)&&void 0!==h?h:Ss,f.networkSubscribe=new Se,f.networkSubscribe.on("network",(function(e,t,n,i){var r;f.emit("network",e,t,n,i),null===(r=f.analysis)||void 0===r||r.network(f.work,e,t,n,i)})),f.boundingMesh=Qr(new i.Box3(new i.Vector3(-.5,-.5,-.5),new i.Vector3(.5,.5,.5))),f.boundingMesh.name="bounding",f.scene.add(f.boundingMesh),f.model=new Yi({allowHosts:[],requestProxy:f.requestProxy,networkSubscribe:f.networkSubscribe},f.renderer);var v=Qr(Is);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 i.Group,f.helperGroup.name="helper",f.scene.add(f.helperGroup),f.videoTexture=new i.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 i.DirectionalLight(16777215,.5)).position.copy(new i.Vector3(1,1,1)),e.add(t);var t=new i.DirectionalLight(16777215,.3);e.add(t),t=new i.AmbientLight(16777215,.3),e.add(t)}(f.scene),f.state={mode:null!==(d=f.currentMode)&&void 0!==d?d:Zi,panoIndex:null!==(p=f.panoIndex)&&void 0!==p?p: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(),f.stopAnimationLoop=Fe.shared.add((function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];f.updateTime.apply(f,oe([e,t],n,!1))}),!1,0,10));var m=function(){"undefined"!=typeof document&&null===document.fullscreenElement&&"VRPanorama"===f.currentMode&&f.controller.emit("vrWantsToExit")};if("undefined"!=typeof document&&document.addEventListener("fullscreenchange",m,!1),f.removeEventListeners=function(){"undefined"!=typeof document&&document.removeEventListener("fullscreenchange",m,!1)},f.plugins={},t.plugins&&t.plugins.length)for(var g=0,y=t.plugins;g<y.length;g++){var b=y[g];if("function"==typeof b)b(f);else if(Array.isArray(b)){var x=b[0],w=b[1],M=b[2];if("function"==typeof x){var C=x(f,M);"string"==typeof w&&(f.plugins[w]?f.throwError(new Error("plugin name ".concat(w," is exists."))):f.plugins[w]=C)}}}return f.gpuPickingRenderTarget=new i.WebGLRenderTarget(1,1),f.meshReplaceMaterialMap=new Map,f.meshOriginMaterialMap=new Map,f}return ie(t,e),Object.defineProperty(t,"version",{get:function(){return"5.0.0-alpha.210"},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,t,n,r,o){var a=this;if(void 0===r&&(r=1),void 0===o&&(o=new i.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 i.Mesh&&!(e instanceof je)){var t=Object.keys(n).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 i.ShaderMaterial({uniforms:{color:{value:n[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 i.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 i.Mesh&&!(e instanceof je)&&a.meshOriginMaterialMap.get(e.uuid)&&(e.material=a.meshOriginMaterialMap.get(e.uuid))})),this.model.setMaterial({modelColorInfo:null});var c=Object.keys(n).filter((function(e){return n[e].equals((new i.Color).setRGB(l[0]/255,l[1]/255,l[2]/255))}))[0];return c||!1},t.prototype.dispose=function(){var e,t;if(!0!==this.destroyed){delete Fs.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 n=this.getElement();n&&n.parentNode&&n.parentNode.removeChild(n),this.scene.remove(this.model);var i=this.model.getMaterial();i&&(i.pano0&&i.pano0.map.dispose(),i.pano1&&i.pano1.map!==(null===(t=i.pano0)||void 0===t?void 0:t.map)&&i.pano1.map.dispose()),this.model.dispose(),this.diposeGPUPickingMaterial(),this.renderer instanceof Tt&&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,n,r,o;if(e){if(!this.screenBuffers){var a=this.getDrawingBufferSize(Bs);this.screenBuffers=[new i.WebGLRenderTarget(a.x,a.y,{encoding:null!==(n=null===(t=this.renderer)||void 0===t?void 0:t.outputEncoding)&&void 0!==n?n:i.sRGBEncoding}),new i.WebGLRenderTarget(a.x,a.y,{encoding:null!==(o=null===(r=this.renderer)||void 0===r?void 0:r.outputEncoding)&&void 0!==o?o:i.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),e.textureOptions&&(Object.assign(this.textureOptions,e.textureOptions),this.model.updateTexture(this.textureOptions))},t.prototype.appendTo=function(e,t){if(void 0===t&&(t={}),this.renderer)if(this.renderer instanceof Tt){var n=this.getElement();if(n){e.appendChild(n),this.refresh(t);var i=window.getComputedStyle(e).position;"relative"!==i&&"absolute"!==i&&"fixed"!==i&&"sticky"!==i&&(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 n=this.getElement();if(n){var r=n.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 Tt&&(t&&this.renderer.setPixelRatio(t),this.renderer.setSize(a,l))}var c=this.renderer.getSize(new i.Vector2);this.camera.aspect=c.x*this.scissor.width/(c.y*this.scissor.height),this.camera.updateProjectionMatrix(),this.controller&&this.controller.updateRenderSize&&this.controller.updateRenderSize(),this.needsRender=!0}}},t.prototype.addExtraElement=function(e){var t=this;return-1===this.extraElements.indexOf(e)&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return t.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var t=this.extraElements.indexOf(e);-1!==t&&(this.extraElements.splice(t,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getPose=function(){var e=this.camera.copyPose(),t=e.longitude,n=e.latitude,i=e.fov,r=e.offset,o=e.distance;return{longitude:t,latitude:n,fov:i,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,n){return void 0===n&&(n=!0),this.controller?this.controller.updateCamera(e,t,n):Promise.reject(new Error("controller is not initialized."))},t.prototype.updateCameraWithKeyframes=function(e,t,n){return void 0===n&&(n=!0),this.controller?this.controller.updateCameraWithKeyframes(e,t,n):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 i.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 n=new i.Vector3(0,0,-1);n.applyQuaternion(e.quaternion);var r=t.quaternion.clone().inverse();return n.applyQuaternion(r),{theta:Math.atan2(n.x,-n.z),phi:-Math.asin(n.y),lookAtVector:n}}(this.camera,t)}},Object.defineProperty(t.prototype,"work",{get:function(){var e=Ls.get(this);if(e&&cr.get(e))return e},enumerable:!1,configurable:!0}),t.prototype.load=function(e,t,n,i){var r=this;if(void 0===i&&(i=!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,n,i):e.then((function(e){return r.load_(e,t,n,i)}));var o}));return this.lastLoadWorkTask=o.catch((function(e){r.throwError(e)})),o},t.prototype.load_=function(e,n,r,o){var a,s,l,c,u,h,d,p,f,A=this;void 0===o&&(o=!0);var v,m,g,y=fr(e),b=this.work;void 0===n&&(n=b?"inherit":"initial"),"inherit"===n?(v="number"==typeof this.panoIndex&&y.observers[this.panoIndex]?this.panoIndex:y.initial.panoIndex,m=null!==(a=this.currentMode)&&void 0!==a?a:y.initial.mode,g={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):"initial"===n?(m=null!==(s=this.currentMode)&&void 0!==s?s:y.initial.mode,v=y.initial.panoIndex,g=m===t.Mode.Panorama||m===t.Mode.DepthPanorama||m===t.Mode.Model||m===t.Mode.VRPanorama||m===t.Mode.XRPanorama?{longitude:y.initial.longitude,latitude:y.initial.latitude,fov:y.initial.fov}:{longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov}):(v=null!==(l=n.panoIndex)&&void 0!==l?l:y.initial.panoIndex,m=null!==(u=null!==(c=n.mode)&&void 0!==c?c:this.currentMode)&&void 0!==u?u:Zi,g={longitude:null!==(h=n.longitude)&&void 0!==h?h:y.initial.longitude,latitude:null!==(d=n.latitude)&&void 0!==d?d:y.initial.latitude,fov:null!==(p=n.fov)&&void 0!==p?p:y.initial.fov}),this.emit("willLoad",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov});var x=function(){var t;A.panoIndex=v,A.panoramaLikeSavedPose.longitude=y.initial.longitude,A.panoramaLikeSavedPose.latitude=y.initial.latitude,A.panoramaLikeSavedPose.fov=y.initial.fov;var n=A.controller?null!=r?r:A.modeChangeDuration:0,i=re(re({initial:[v,g,n,o]},A.commonParams()),A.controllerInits[m]);A.controller?!1===A.controller.updateWork(y,v,g,n,o)&&(A.controller.destroy(),A.controller=A.applyController(m,i)):A.controller=A.applyController(m,i),A.emit("load",e,y,{panoIndex:v,mode:m,longitude:g.longitude,latitude:g.latitude,fov:g.fov}),null===(t=A.analysis)||void 0===t||t.work(y)},w=function(e){var t;void 0===e&&(e=ue),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())};Ls.set(this,y);for(var M=new i.Box3,C=0,E=y.observers;C<E.length;C++){var I=E[C];M.expandByPoint(I.standingPosition),M.expandByPoint((new i.Vector3).fromArray([I.position.x,2*I.position.y-I.standingPosition.y,I.position.z]))}return this.model.bounding.union(M),m===t.Mode.Floorplan||m===t.Mode.Topview||m===t.Mode.Mapview||m===t.Mode.Model?w((function(){x(),A.needsRender=!0})):(this.controller||(this.camera.setFromPose({distance:0,fov:y.initial.fov,longitude:y.initial.longitude,latitude:y.initial.latitude,offset:y.observers[y.initial.panoIndex].position}),this.needsRender=!0),x(),null===(f=this.controller)||void 0===f||f.once("panoLoaded",(function(){A.needsRender=!0,A.emit("cameraUpdate",A.camera.copyPose(),o),w()}))),this.ready().then((function(){A.emit("loaded",e,A.work)}))},t.prototype.changeMode=function(e,n,i,r,o){var a=this;if(void 0===n&&(n={}),void 0===i&&(i=this.modeChangeDuration),void 0===r&&(r=!0),void 0===o&&(o=!1),!this.renderer)throw new Error("renderer is not initialized.");return new Promise((function(s,l){if(!t.Mode.hasOwnProperty(e)){var c=new Error('mode "'.concat(e,'" is not existed'));return a.throwError(c),void l(c)}if((e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(Ki(a.model)||!0!==a.model.loaded)){c=new Error("model is not ready.");return a.throwError(c),void l(c)}if(Ki(a.controller)){c=new Error("controller is not ready.");return a.throwError(c),void l(c)}var u=a.controller,h=a.currentMode,d=function(){var c,d,p,f;if(a.emit("wantsChangeMode",e,h))l(new Error("change mode canceled."));else{if(a.controller&&!1===o&&h===e)e===t.Mode.Panorama||e===t.Mode.DepthPanorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?"number"==typeof n.panoIndex&&n.panoIndex!==a.panoIndex?a.controller.moveToPano(null!==(d=null!==(c=n.panoIndex)&&void 0!==c?c:a.panoIndex)&&void 0!==d?d:0,re({duration:i},n),r):a.controller.updateCamera(n,i,r).catch(ue):("number"==typeof n.panoIndex&&n.panoIndex!==a.panoIndex&&(a.panoIndex=n.panoIndex),a.controller.updateCamera(n,i,r).catch(ue));else{u.destroy();var A=null!==(f=null!==(p=n.panoIndex)&&void 0!==p?p:a.panoIndex)&&void 0!==f?f:0,v=cs(e)?a.panoramaLikeSavedPose:{};e===t.Mode.Mapview&&(v.longitude=a.panoramaLikeSavedPose.longitude),"number"!=typeof n.longitude&&"number"!=typeof n.latitude||(v.longitude=n.longitude,v.latitude=n.latitude),"number"==typeof n.fov&&(v.fov=n.fov),"Mapview"===e&&(v.distance=n.distance,v.offset=n.offset);var m=re(re({initial:[A,v,i,r]},a.commonParams()),a.controllerInits[e]);a.saveControllerPose(u),a.controller=a.applyController(e,m);var g=ls[e].initAnimationEndPose(m);a.emit("modeChange",e,h,A,g,r)}s()}};if(e===t.Mode.VRPanorama)a.requestFullscreen(),("undefined"==typeof location||"https:"!==location.protocol?Promise.reject(new Error("Request DeviceOrientation Permission denied.")):"undefined"!=typeof DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((function(e){if("granted"==e)return Promise.resolve();var t=new Error("Request DeviceOrientation Permission denied.");return Promise.reject(t)})):Promise.resolve()).then((function(){return d()})).catch((function(e){e instanceof Error&&(a.exitFullscreen(),a.throwError(e),l(e))}));else if(e===t.Mode.XRPanorama){var p=Fe.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){Fe.shared.setContext(e),d()})).catch((function(e){e instanceof Error&&(a.throwError(e),l(e))}))}else e===t.Mode.Mapview?(a.model&&a.model.originModel&&a.model.tiledModel&&(a.model.originModel.visible=!0,a.model.tiledModel.reset()),d()):d()}))},t.prototype.getPixels=function(e,t,n,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 i.Vector2);e=Gt(e,Math.floor(n/2),Math.floor(s.x-n)),t=Gt(t,Math.floor(r/2),Math.floor(s.y-r)),a.setSize(n*o,r*o),this.renderer.setRenderTarget(a),this.camera.setViewOffset(s.width,s.height,e,s.height-t-r,n,r),this.controller?this.controller.render():this.renderer.render(this.scene,this.camera);var l=new Uint8Array(n*o*r*o*4);return this.renderer.readRenderTargetPixels(a,0,0,n*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 n,i=this;if(void 0===t&&(t=!1),!this.renderer)return null;var r=_e.shared,o=null===(n=this.model.getMaterial())||void 0===n?void 0:n.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(Bs);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(Bs);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&&Es(this.renderer),this.renderer.setRenderTarget(null),e&&Fe.shared.add(e,!0),this.screenBuffers[0]}return this.aroundScissor((function(){i.renderer&&(i.controller?i.controller.render():i.renderer.render(i.scene,i.camera),i.poweredByRealsee&&"VRPanorama"!==i.currentMode&&"XRPanorama"!==i.currentMode&&Es(i.renderer)),e&&Fe.shared.add(e,!0)})),null},t.prototype.updateTime=function(e,t){for(var n,r,o,a,s=this,l=[],c=2;c<arguments.length;c++)l[c-2]=arguments[c];if(!this.destroyed){this.syncingState=this.syncState(e,t),this.controller&&(n=this.controller).updateTime.apply(n,oe([e,t],l,!1)),this.syncingState=!1,this.camera.updateTime(e,t);var u=new i.Vector2(512,512),h=new i.Vector2(512,512);this.renderer&&(this.renderer.getSize(u),u.x*=this.scissor.width,u.y*=this.scissor.height,this.renderer.getDrawingBufferSize(h),h.x*=this.scissor.width,h.y*=this.scissor.height),this.renderer&&this.model.update(this.renderer,this.camera);var d=new i.Box3;this.work&&d.union(this.work.boundingBox),this.model.empty||d.union(this.model.bounding),d.max.x+=1,d.max.y+=1,d.max.z+=1,d.min.x-=1,d.min.y-=.001,d.min.z-=1,d.getCenter(this.boundingMesh.position),d.getSize(this.boundingMesh.scale),this.boundingMesh.boundingBox.copy(d);var p=null!==(r=this.model.getMaterial())&&void 0!==r?r:{},f=1-(null!==(o=p.modelAlpha)&&void 0!==o?o:0);p.opacity=Gt(4*f-3,0,1),delete p.clipperFloors,delete p.clipperPlanesArray,delete p.clippers,this.boundingMesh.setMaterial(p),this.boundingMesh.setTransparent(1!==f);var A=[];Ps.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ts.setFromProjectionMatrix(Ps);for(var v=0,m=this.scene.children;v<m.length;v++){var g=m[v];g!==this.model&&(g instanceof i.Object3D&&g.traverseVisible((function(t){if(t.setResolution&&t.setResolution(u.x,u.y),t.setTime&&t.setTime(e),t.mixer instanceof i.AnimationMixer){var n=Rs.get(t.mixer);n||(n=new i.Clock,Rs.set(t.mixer,n)),t.mixer.update(n.getDelta())}(t instanceof i.Mesh||t instanceof i.Line||t instanceof i.Points)&&(t instanceof i.ImmediateRenderObject||!t.frustumCulled||Ts.intersectsObject(t))&&A.push(t)})))}if(h.width*h.height>8388608?this.renderSwitch01=1^this.renderSwitch01:this.renderSwitch01=0,this.renderer&&!1===this.paused&&0===this.renderSwitch01){var y=void 0;if(!0!==this.onlyRenderIfNeeds)y=this.render();else{if(this.controller&&!0===this.controller.needsRender&&(this.controller.needsRender=!1,this.needsRender=!0),!0===this.camera.needsRender&&(this.camera.needsRender=!1,this.needsRender=!0),!0===this.model.needsRender&&(this.model.needsRender=!1,this.needsRender=!0),!0===(null===(a=this.model.tiledModel)||void 0===a?void 0:a.needsRender)&&(this.model.tiledModel.needsRender=!1,this.needsRender=!0),!0!==this.needsRender)for(var b=0,x=A;b<x.length;b++){var w=x[b],M=function(e){!0===e.needsRender?(e.needsRender=!1,s.needsRender=!0):e.mixer&&e.mixer.stats.actions.inUse>0&&(s.needsRender=!0)};M(w),w.traverseAncestors(M)}!1!==this.needsRender&&(y=this.render())}if(this.needsRender=!1,this.controller&&this.screenBuffers){var C=this.controller,E=this.screenBuffers;this.aroundScissor((function(){C.postProcessing(E[0],E[1]),s.copyEffect.render(E[1],void 0)}))}this.hasListener("renderFrame")&&this.emit("renderFrame",void 0!==y)}this.fps.testTime&&e-this.fps.testTime<1e3?this.fps.testCount++:(this.emit("fps",this.fps.testCount),this.fps.testTime=e,this.fps.testCount=0)}},t.prototype.pause=function(){this.paused=!0,this.renderer&&this.renderer instanceof Tt&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,n,i){var r=this;void 0===n&&(n={}),void 0===i&&(i=!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?Ki(e)||(this.panoIndex=e,this.once("initAnimationWillStart",(function(e,i){r.currentMode===t.Mode.Panorama&&n.moveStartCallback&&n.moveStartCallback(e,i)})),this.once("initAnimationEnded",(function(e,i){r.currentMode===t.Mode.Panorama&&n.moveEndCallback&&n.moveEndCallback(e,i)})),this.changeMode(t.Mode.Panorama,n,void 0,i)):a.moveToPano(e,n,i),this.ready()):(this.throwError(new Error("renderer is not initialized.")),Promise.resolve()):(this.throwError(new Error("controller is not initialized.")),Promise.resolve())},t.prototype.moveToPanoByRaycaster=function(e){this.controller&&this.controller instanceof ls.XRPanorama&&this.controller.checkSelectedPano(e)},t.prototype.preloadPano=function(e,t){var n=this;if(void 0===t&&(t=ue),!this.work)return Promise.reject(new Error("work never loaded"));var i=this.work.observers[e],r=this.work.allowHosts,o=de();return Promise.all(["right","left","up","down","front","back"].map((function(t){var o=re({key:"pano.".concat(e,".").concat(t)},un(n.imageOptions,["size","format","quality","mappings"])),a=i.images[t];return Pe(n.imageOptions.transform?n.imageOptions.transform(a,o):Ue(a,o),{allowHosts:r,requestProxy:n.requestProxy,networkSubscribe:n.networkSubscribe})}))).then((function(){var e=de()-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 n=this.camera.position,r=e.clone().sub(n),o=new i.Raycaster(n,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 i.Vector2),c=l.x*this.scissor.width,u=l.y*this.scissor.height,h=l.x*this.scissor.left+(s.x+1)/2*c,d=l.y*(1-this.scissor.bottom-this.scissor.height)+(1-s.y)/2*u;return new i.Vector2(h,d)},t.prototype.getRenderObjects=function(e){Ps.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),Ts.setFromProjectionMatrix(Ps),e||(e=this.scene);var t=[];return e.traverseVisible((function(e){(e instanceof i.Mesh||e instanceof i.Line||e instanceof i.Points)&&(e instanceof i.ImmediateRenderObject||!e.frustumCulled||Ts.intersectsObject(e))&&t.push(e)})),t},t.prototype.getCurrentState=function(){return re(re({},this.getPose()),{mode:this.currentMode||t.Mode.Panorama,panoIndex:this.panoIndex||0})},t.prototype.setState=function(e,n,r){var o,a,s,l,c,u,h,d,p;void 0===n&&(n=!1),void 0===r&&(r=!0),!(e=Object.assign({},e)).offset||e instanceof i.Vector3||(e.offset=new i.Vector3(e.offset.x,e.offset.y,e.offset.z));var f,A,v,m,g,y=null!==(o=e.panoIndex)&&void 0!==o?o:this.state.panoIndex,b=null!==(a=e.mode)&&void 0!==a?a:this.state.mode;if(this.work)if(this.work.observers[y])if(e.mode!==t.Mode.Floorplan&&e.mode!==t.Mode.Topview&&e.mode!==t.Mode.Mapview&&e.mode!==t.Mode.Model||!Ki(this.model)&&!0===this.model.loaded){if(this.state.mode!==b){if("VRPanorama"===b)return void this.changeMode("VRPanorama",void 0,void 0,!0);var x=void 0;x=cs(this.state.mode)&&cs(b)?re({},this.state):cs(b)?re({},this.panoramaLikeSavedPose):b===t.Mode.Mapview?{longitude:this.panoramaLikeSavedPose.latitude}:re({},e),"number"==typeof e.longitude&&(x.longitude=e.longitude),"number"==typeof e.latitude&&(x.latitude=e.latitude),"number"==typeof e.fov&&(x.fov=e.fov),"number"==typeof e.distance&&"Mapview"===e.mode&&(x.distance=e.distance),e.offset instanceof i.Vector3&&"Mapview"===e.mode&&(x.offset=e.offset);var w=re(re({initial:[y,x,this.modeChangeDuration,!1]},this.commonParams()),this.controllerInits[b]),M=ls[b].initAnimationEndPose(w);f=M.longitude,A=M.latitude,v=M.fov,m=M.offset,g=M.distance}else f=null!==(s=e.longitude)&&void 0!==s?s:this.state.longitude,A=null!==(l=e.latitude)&&void 0!==l?l:this.state.latitude,v=null!==(c=e.fov)&&void 0!==c?c:this.state.fov,m=null!==(u=e.offset)&&void 0!==u?u:this.state.offset,g=null!==(h=e.distance)&&void 0!==h?h:this.state.distance;var C={panoIndex:y,mode:b,longitude:f,latitude:A,fov:v,offset:m,distance:g};this.emit("setState",C),Kr(this.state,C)||(this.controller&&"VRPanorama"===C.mode&&C.mode!==this.state.mode?(jr(this.state,C),this.changeMode("VRPanorama")):this.controller&&"XRPanorama"===C.mode&&C.mode!==this.state.mode?(jr(this.state,C),this.changeMode("XRPanorama")):(jr(this.state,C),this.controller&&r&&(this.controller.userAction=!1),n&&this.state.mode===C.mode&&(this.syncingState=this.syncState(de(),0,n),this.syncingState&&(null===(d=this.controller)||void 0===d||d.updateTime(de(),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 i.Vector2,n=0!==this.scissor.left||0!==this.scissor.bottom||1!==this.scissor.width||1!==this.scissor.height;if(n){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(),n&&(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,n,r){void 0===r&&(r=!1);var o=this.stateSynced;if(this.stateSynced=!1,!this.work)return!1;if(!this.controller)return!1;if(this.state.mode!==this.currentMode){var a={mode:this.state.mode,panoIndex:this.state.panoIndex,longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.changeMode(this.state.mode,a,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof ls.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,re(re({},s),{duration:r?0:void 0}),!1),!0}}else if(this.state.panoIndex!==this.panoIndex){s={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(this.state.panoIndex,s,!1),!0}if(this.controller instanceof ls.Topview||this.controller instanceof ls.Mapview){var l=1,c=Math.PI/45,u=r?this.state.fov:qr(this.camera.pose.fov,this.state.fov,l),h=r?this.state.distance:qr(this.camera.pose.distance,this.state.distance,.2),d=r?new i.Vector3(this.state.offset.x,this.state.offset.y,this.state.offset.z):new i.Vector3(qr(this.camera.pose.offset.x,this.state.offset.x,.2),qr(this.camera.pose.offset.y,this.state.offset.y,.2),qr(this.camera.pose.offset.z,this.state.offset.z,.2)),p=r?{longitude:this.state.longitude,latitude:this.state.latitude}:Hr({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},c),f=p.longitude,A=p.latitude;if(this.controller instanceof ls.Mapview){if(Lr(u,this.camera.pose.fov)||Fr(d,this.camera.pose.offset)||Lr(h,this.camera.pose.distance)||Lr(f,this.camera.pose.longitude,2*Math.PI)||Lr(A,this.camera.pose.latitude)){var v={x:d.x,y:d.y,z:d.z},m={fov:u};return Object.assign(v,{distance:h}),Object.assign(m,{longitude:f,latitude:A}),this.controller.cameraMotion.set(m,0).catch(ue),this.controller.locationMotion.set(v,0).catch(ue),!0}}else if(Lr(u,this.camera.pose.fov)||Fr(d,this.camera.pose.offset)){v={x:d.x,y:d.y,z:d.z},m={fov:u};return this.controller.cameraMotion.set(m,0).catch(ue),this.controller.locationMotion.set(v,0).catch(ue),!0}}else{l=1,c=Math.PI/45,u=r?this.state.fov:qr(this.camera.pose.fov,this.state.fov,l);var g=r?{longitude:this.state.longitude,latitude:this.state.latitude}:Hr({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},c);f=g.longitude,A=g.latitude;if(Lr(f,this.camera.pose.longitude,2*Math.PI)||Lr(A,this.camera.pose.latitude)||Lr(u,this.camera.pose.fov))return this.controller.cameraMotion.set({longitude:f,latitude:A,fov:u},0).catch(ue),!0}if(this.stateSynced=!0,!1===o&&this.emit("stateSynced",this.state),this.readyCallbacks.length&&this.stateSynced){var y=this.currentMode;if(!(y===t.Mode.Floorplan||y===t.Mode.Topview||y===t.Mode.Mapview||y===t.Mode.Model)||!this.modelPending){var b=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var x=0,w=b;x<w.length;x++){var M=w[x];this.controller instanceof ls.Panorama?!0!==M.tile||this.controller.isTileReady()?M():this.readyCallbacks.push(M):M()}}}return!1},t.prototype.ready=function(e){var t=this;return void 0===e&&(e={}),new Promise((function(n){var i;t.readyCallbacks.push(Object.assign(n,{tile:null!==(i=e.tile)&&void 0!==i&&i}))}))},t.prototype.requestFullscreen=function(){var e;if(_r()){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,n,r,o){var a=this,s=t.file;this.emit("modelWillLoad",t);var l=new Yi({allowHosts:n,requestProxy:this.requestProxy,networkSubscribe:this.networkSubscribe},this.renderer);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,n,o,c;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 u,h=a.model;h&&(h.show(),u=h.getMaterial()||{},a.scene.remove(h),h.dispose(),l.setTransparent(h.getTransparent())),u&&l.setMaterial(u),a.model=l,a.scene.add(l),null===(n=a.controller)||void 0===n||n.updateModel(l),null===(o=a.renderer)||void 0===o||o.compile(a.scene,a.camera),a.needsRender=!0,a.modelPending=!1,r();var d=[];null===(c=a.model.originModel)||void 0===c||c.children.forEach((function(e){var t=new i.Box3;e.traverse((function(e){e instanceof i.Mesh&&t.union(e.geometry.boundingBox)})),d.push(new i.Vector3(t.max.y,t.min.y,0))})),a.model.setMaterial({globalFloorInfo:d}),a.model.updateTexture(a.textureOptions),a.emit("modelLoaded",l)}})),l.on("shownFloorChange",(function(e,t){var n,i;a.destroyed||s===(null===(i=null===(n=a.work)||void 0===n?void 0:n.model)||void 0===i?void 0:i.file)&&a.emit("modelShownFloorChange",e,t)})),l.on("error",(function(e){var t,n,o,c;if(!a.destroyed&&s===(null===(n=null===(t=a.work)||void 0===t?void 0:t.model)||void 0===n?void 0:n.file)){l.bounding.makeEmpty();for(var u=0,h=a.work.observers;u<h.length;u++){var d=h[u];l.bounding.expandByPoint(d.standingPosition),l.bounding.expandByPoint((new i.Vector3).fromArray([d.position.x,2*d.position.y-d.standingPosition.y,d.position.z]))}var p=Qr(l.bounding,new i.Vector3(1,0,1));p.visible=!0,p.name="model_empty",l.add(p);var f,A=a.model;A&&(A.show(),f=A.getMaterial()||{},a.scene.remove(A),A.dispose(),l.setTransparent(A.getTransparent())),f&&l.setMaterial(f),a.model=l,a.scene.add(l),null===(o=a.controller)||void 0===o||o.updateModel(l),null===(c=a.renderer)||void 0===c||c.compile(a.scene,a.camera),a.emit("modelLoadError",e,l),a.throwError(e),a.modelPending=!1,r()}})),this.modelPending=!0,l.load(t,this.textureOptions,this.modelLodOptions).catch(ue)},t.prototype.commonParams=function(){return{ident:this.ident,scene:this.scene,xrCustomObjectsScene:this.xrCustomObjectsScene,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&&cs(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,n){var i=this;if(!this.renderer)throw new Error("renderer is not initialized.");var r=ls[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(n),a=function(e){o.on(e,(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(i.emit.apply(i,oe([e],t,!1)))return!1}))},s=0,l=us;s<l.length;s++){a(l[s])}var c=ls[e].initAnimationEndPose(n),u=n.initial[3],h={panoIndex:n.initial[0],mode:e,longitude:c.longitude,latitude:c.latitude,fov:c.fov,offset:c.offset,distance:c.distance};return Kr(this.state,h)||(jr(this.state,h),this.emit("stateChange",this.state,u)),this.emit("currentStateChange",this.getCurrentState(),u),o.on("cameraUpdate",(function(t,n){var r;if(i.controller){var o=re(re({},i.controller.getTargetPose()),{panoIndex:i.panoIndex,mode:e});!1!==i.syncingState||i.state.mode!==o.mode||Kr(i.state,o)||(jr(i.state,o),i.emit("stateChange",i.state,n),null===(r=i.analysis)||void 0===r||r.state(i.work,i.state))}i.emit("currentStateChange",i.getCurrentState(),n)})),o.on("initAnimationWillStart",(function(t,n,r){var o,a=re(re({},n),{panoIndex:t,mode:e});r&&i.state.mode===a.mode&&!Kr(i.state,a)&&(jr(i.state,a),i.emit("stateChange",i.state,r),null===(o=i.analysis)||void 0===o||o.state(i.work,i.state))})),o.on("initAnimationEnded",(function(t,n,r){var o,a=re(re({},n),{panoIndex:t,mode:e});r&&i.state.mode===a.mode&&!Kr(i.state,a)&&(jr(i.state,a),i.emit("stateChange",i.state,r),null===(o=i.analysis)||void 0===o||o.state(i.work,i.state))})),o.on("panoWillArrive",(function(t,n,r){var o;i.panoIndex=t;var a=re(re({},n),{panoIndex:t,mode:e});r&&i.state.mode===a.mode&&!Kr(i.state,a)&&(jr(i.state,a),i.emit("stateChange",i.state,r),null===(o=i.analysis)||void 0===o||o.state(i.work,i.state))})),o.on("panoArrived",(function(t,n,r){var o,a=re(re({},n),{panoIndex:t,mode:e});r&&i.state.mode===a.mode&&!Kr(i.state,a)&&(jr(i.state,a),i.emit("stateChange",i.state,r),null===(o=i.analysis)||void 0===o||o.state(i.work,i.state))})),o.on("moveToPano",(function(e,t){i.emit("currentStateChange",i.getCurrentState(),t)})),o.on("wantsMoveToPano",(function(e,t,n){var r=i.emit("wantsMoveToPano",e,t,n);r||(r=i.emit("wantsToMoveToPano",e,t,n)),r||i.moveToPano(e,t,n)})),o.on("vrWantsToExit",(function(){i.currentMode===t.Mode.VRPanorama&&(i.exitFullscreen(),i.changeMode(t.Mode.Panorama))})),o.on("error",(function(e){return i.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}(ce),Fs={instances:{},constructor:Os};"undefined"!=typeof window&&Object.assign(window,{__FIVE_DEBUG__:Fs});var ks=function(){function e(){}return e.createButton=function(e){var t=document.createElement("button");function n(){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 i(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",i(t),navigator.xr.isSessionSupported("immersive-vr").then((function(i){i?(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()}):n()})),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",i(r),r},e}();exports.AnimationFrameLoop=Fe,exports.BVH=Xt,exports.BVHIntersect=qt,exports.BVHNode=zt,exports.BVHVector3=Ut,exports.Camera=Vt,exports.Clipper=_e,exports.Five=Os,exports.InternalWebGLRenderer=Tt,exports.IntersectMesh=Pr,exports.Model=Yi,exports.NetworkSubscribe=Se,exports.PBMContainer=Ke,exports.PBMGroup=Ge,exports.PBMMaterial=Bt,exports.PBMMesh=je,exports.PROXY_CONTROLLER_EVENT_NAMES=us,exports.PanoCircleMesh=xr,exports.PanoCircleMeshCustom=Sr,exports.PanoCircleMeshSolid=Cr,exports.Scene=Pt,exports.Subscribe=ce,exports.TILE_EVENT=Hi,exports.TextureLoader=Mt,exports.Tile3D=Bi,exports.Tile3DModel=ji,exports.TileBoundingSphere=ni,exports.TileCacheNode=jn,exports.TileCubeTextureTarget=wt,exports.TileCullingVolume=Jn,exports.TileOrientedBoundingBox=xi,exports.TileRequestScheduler=_n,exports.Tileset3D=Li,exports.Tileset3DTraverser=Pi,exports.TilesetCache=Gn,exports.Work=ur,exports.XRButton=ks,exports.defaultImageURLTransform=Ue,exports.getViewportScale=ds,exports.imageSupport=function(){return He||(He=Promise.all([qe("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),qe("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=fr;