@realsee/five 6.7.0-alpha.1 → 6.7.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/{five.Tile3DModel.html → five.Tile3D.html} +27 -28
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +1 -1
- package/docs/classes/five.WorkResolvedObserver.html +1 -1
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/five.LooseWorkPanorama.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.ModelLike.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.Tile3DOptions.html +11 -0
- package/docs/interfaces/five.TileCoordinateSystem.html +3 -0
- package/docs/interfaces/five.ViewLayer.html +27 -28
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/modules/five.html +1 -1
- package/docs/types/five.ParseOptions.html +6 -6
- package/five/index.d.ts +18 -11
- package/five/index.js +7 -7
- package/five/index.mjs +24 -27
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +7 -7
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
- package/docs/interfaces/five.Tile3DModelLoaderOptions.html +0 -12
package/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 9/
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
4
|
+
* Generated: 9/26/2025
|
|
5
|
+
* Version: 6.7.0-alpha.3
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -1023,9 +1023,9 @@ void main() {
|
|
|
1023
1023
|
#include <fog_fragment>
|
|
1024
1024
|
#include <premultiplied_alpha_fragment>
|
|
1025
1025
|
}
|
|
1026
|
-
`,uniforms:{diffuse:{value:new THREE__namespace.Color},opacity:{value:1},displacementScalar:{value:0}}};function createPipeBufferGeometry(n,t,e,r){for(var o=new Float32Array((e+1)*(r+1)*3),s=new Float32Array((e+1)*(r+1)*3),u=new Float32Array((e+1)*(r+1)*2),l=new Uint32Array(e*r*6),c=n.computeFrenetFrames(e),p=new THREE__namespace.Vector3,f=new THREE__namespace.Vector3,d=new THREE__namespace.Vector2,h=new THREE__namespace.Vector3,m=0;m<=e;m++){h=n.getPointAt(m/e,h);for(var A=c.normals[m],g=c.binormals[m],y=0;y<=r;y++){var v=m*(r+1)+y,E=y/r*Math.PI*2,b=Math.sin(E),T=-Math.cos(E);f.x=T*A.x+b*g.x,f.y=T*A.y+b*g.y,f.z=T*A.z+b*g.z,f.normalize(),f.toArray(s,v*3),p.x=h.x+t*f.x,p.y=h.y+t*f.y,p.z=h.z+t*f.z,p.toArray(o,v*3),d.x=m/e,d.y=y/r,d.toArray(u,v*2)}}for(var m=0;m<e;m++)for(var y=0;y<r;y++){var _=(m*r+y)*6,S=(r+1)*m+y,R=(r+1)*(m+1)+y,w=(r+1)*(m+1)+(y+1),M=(r+1)*m+(y+1);l[_]=S,l[_+1]=R,l[_+2]=M,l[_+3]=R,l[_+4]=w,l[_+5]=M}var B=new THREE__namespace.BufferGeometry;return B.setIndex(new THREE__namespace.BufferAttribute(l,1)),B.setAttribute("position",new THREE__namespace.BufferAttribute(o,3)),B.setAttribute("normal",new THREE__namespace.BufferAttribute(s,3)),B.setAttribute("uv",new THREE__namespace.BufferAttribute(u,2)),B}function parseTrajectoryObject(n,t){for(var e=new THREE__namespace.Color(0).convertSRGBToLinear(),r=new THREE__namespace.Color(52949).convertSRGBToLinear(),o=new THREE__namespace.Color(3370495).convertSRGBToLinear(),s=new THREE__namespace.Color(16777215).convertSRGBToLinear(),u=0,l=new THREE__namespace.CurvePath,c=n.length,p=3;p<c;p+=3){var f=new THREE__namespace.Vector3().fromArray(n,p-3),d=new THREE__namespace.Vector3().fromArray(n,p);u+=f.distanceTo(d);var h=new THREE__namespace.LineCurve3(f,d);l.add(h)}var m=.03,A=Math.ceil(u*100),g=6,y=createPipeBufferGeometry(l,m,A,g);y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,1),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,2);var v=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});v.uniforms.totalLength.value=u,v.uniforms.diffuse.value=e,v.uniforms.diffuse2.value=e,v.uniforms.opacity.value=.5,v.transparent=!0;var E=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});E.uniforms.totalLength.value=u,E.uniforms.displacementScalar.value=-.01,E.uniforms.diffuse.value=r,E.uniforms.diffuse2.value=o;var b=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.DoubleSide});b.uniforms.totalLength.value=u,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new THREE__namespace.Vector2(.06,.09),b.uniforms.diffuse.value=s,b.uniforms.diffuse2.value=s;var T=new THREE__namespace.Mesh(y,[v,E,b]),_=.08,S=24,R=new THREE__namespace.SphereBufferGeometry(_,S,S);R.clearGroups(),R.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),R.addGroup(0,y.index?y.index.count:y.attributes.position.count,1);var w=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.BackSide});w.uniforms.diffuse.value=e,w.uniforms.opacity.value=.5,w.transparent=!0;var M=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});M.uniforms.displacementScalar.value=-.01,M.uniforms.diffuse.value=r;var B=new THREE__namespace.Mesh(R,[w,M]);B.position.fromArray(n,0),T.add(B);var C=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=o;var P=new THREE__namespace.Mesh(R,[w,C]);return P.position.fromArray(n,n.length-3),T.add(P),{scene:T,dispose:function(){y.dispose(),v.dispose(),E.dispose(),b.dispose(),R.dispose(),w.dispose(),M.dispose(),C.dispose()}}}function loadTrajectory(n,t){var e=n.name,r=appendSearch(n.content.uri,t.search),o=imageURL(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=now(),loadPly(o,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(s){var u,l,c,p,f=(l=(u=s.scene.attributes)===null||u===void 0?void 0:u.time.array)!==null&&l!==void 0?l:[],d=(p=(c=s.scene.attributes)===null||c===void 0?void 0:c.position.array)!==null&&p!==void 0?p:[],h=s.byteLength,m=s.memoryUsage,A=parseTrajectoryObject(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var g=new TrajectoryNode(e,A.scene);return n.content.data={uri:o,byteLength:h,memoryUsage:m,positionArray:d,timeArray:f,object:g},n.content.byteLength=h,n.content.memoryUsage=m,n.content.loadState="READY",n.content.loadStateUpdateTime=now(),n}).catch(function(s){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=now(),s instanceof NetworkResponseError&&s.httpStatus===0||s instanceof NetworkTimeoutError||s instanceof NetworkProxyError?n.content.loadfailRetryDelay=clamp$1(n.content.loadfailRetryDelay+RETRY_DELAY_STEP,RETRY_DELAY_STEP,MAX_RETRY_DELAY):n.content.loadfailRetryDelay=1/0,Promise.reject(s)})}function unloadTrajectory(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=now(),n.content.byteLength=0,n.content.memoryUsage=0)}var scratchVector3$7=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$3=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),o=1e-12,s=1e3,u=0,l=Math.atan2(n.z,r),c=0;u++<s;){var p=Math.sin(l),f=a/Math.sqrt(1-e*p*p);c=r/Math.cos(l)-f;var d=Math.atan2(n.z/(f*(1-e)+c),r/(f+c));if(isNaN(d))break;var h=Math.abs(d-l);if(h<o)break;l=d}return n.set(l,Math.atan2(n.y,n.x),c)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,o=a-a/invF,s=(a*a-o*o)/(a*a),u=Math.sin(t),l=Math.cos(t),c=Math.sin(e),p=Math.cos(e),f=a/Math.sqrt(1-s*u*u),d=(f+r)*l*p,h=(f+r)*l*c,m=(o*o/(a*a)*f+r)*u;return n.set(d,h,m)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$7.copy(n)),r=e.x,o=e.y,s=e.z,u=Math.sin(r),l=Math.sin(o),c=Math.cos(r),p=Math.cos(o);t.fromArray([-l,-u*p,c*p,0,+p,-u*l,c*l,0,0,c,u,0,0,0,0,1]);var f=scratchMatrix3.setFromMatrix4(t),d=scratchVector3$7.copy(n).applyMatrix3(f).multiplyScalar(-1);t.setPosition(d);var h=scratchMatrix4$3.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,s,1]);return t.premultiply(h),t}var ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),enuToLocalMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),localToEnuMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);function getRecommendTile3dProps(n,t){var e,r,o;t===void 0&&(t={});var s,u,l,c=typeof n.tileset.rootMeta.creationTime=="string";if(c){var p=typeof n.tileset.rootMeta.numTotalPoints=="number"&&n.tileset.rootMeta.numTotalPoints>0;if(p){l=4,t.powerPreference==="high"&&(l=2),s=l/1.6;var f=0;if(((e=n.tileset.rootMeta.taskParameters)===null||e===void 0?void 0:e.point_homogenization)==="1"&&(!((r=n.tileset.rootMeta.taskParameters)===null||r===void 0)&&r.homo_point_density)){var d=Number((o=n.tileset.rootMeta.taskParameters)===null||o===void 0?void 0:o.homo_point_density);isFinite(d)&&!isNaN(d)&&(f=d)}f<=0&&(f=.02),u=f*1.4}else l=5,t.powerPreference==="high"&&(l=4),s=0,u=.03}else l=6,s=0,u=.03,n.name==="aerophoto"?(l=12,t.powerPreference==="high"&&(l=10)):n.tileset.asset.extras&&typeof n.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(n.tileset.asset.extras.name)&&(l=5,t.powerPreference==="high"&&(l=4));return{pointScale:u,pointMinPixel:s,maxScreenSpaceError:l}}var scratchVector3$6=new THREE__namespace.Vector3,scratchSphereBoundingVolume=new SphereBoundingVolume,scratchBoxBoundingVolume=new BoxBoundingVolume,parameterVersionMap=new WeakMap,tileVersionMap=new WeakMap,trajectoryVersionMap=new WeakMap,STENCIL_CONSTANT={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4},SKIP_BACKFACE_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=STENCIL_CONSTANT.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK,n})(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n})(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial;function cloneSkipBackfaceObject(n){var t;n instanceof THREE__namespace.Mesh?t=new THREE__namespace.Mesh(n.geometry,Array.isArray(n.material)?n.material.map(function(s){return s.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):n.material&&n.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):n instanceof THREE__namespace.Group?t=new THREE__namespace.Group:t=new THREE__namespace.Object3D,t.position.copy(n.position),t.quaternion.copy(n.quaternion),t.scale.copy(n.scale),t.matrix.compose(n.position,n.quaternion,n.scale),t.matrixAutoUpdate=!1,t.frustumCulled=n.frustumCulled,t.visible=n.visible;for(var e=0,r=n.children;e<r.length;e++){var o=r[e];t.add(cloneSkipBackfaceObject(o))}return t}var Tile3D=(function(n){__extends(t,n);function t(e,r){var o,s,u=n.call(this)||this;return u.parameter=new Parameter,u.renderObjects=[],u.backfaceObjects=[],u.tileObjects=[],u.frameNumber=0,u.error=(o=r.error)!==null&&o!==void 0?o:null,u.name=r.name,u.type=r.type,u.upAxis=r.upAxis,u.light=r.light,u.fetcher=r.fetcher,u.search=(s=r.search)!==null&&s!==void 0?s:"",u.groundHeight=r.groundHeight,u.enuToEcefMatrix=new THREE__namespace.Matrix4().copy(r.enuToEcefMatrix),u.ecefToEnuMatrix=new THREE__namespace.Matrix4().copy(r.ecefToEnuMatrix),u.boundingBox=new THREE__namespace.Box3,u.autoRefine=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Tileset(e,{tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return Object.defineProperty(t.prototype,"viewerRequestVolume",{get:function(){return this.tileset.root.viewerRequestVolume},set:function(e){this.tileset.root.viewerRequestVolume=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tiles",{get:function(){return this.tileset.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.getRecommendProps=function(e){return e===void 0&&(e={}),getRecommendTile3dProps(this,e)},t.prototype.loadContent=function(e){var r=this;return loadTileContent(e,{light:this.light,fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?unloadTileContent(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return unloadTileContent(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(o){var s=[];return e.tileset.root.traverse(function(u){var l;u.type==="TILESET"&&((l=u.content)===null||l===void 0?void 0:l.loadState)!=="READY"&&s.push(u)}),Promise.all(s.map(function(u){return e.loadContent(u).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return loadTrajectory(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){r.disposed&&unloadTrajectory(o)})},t.prototype.unloadTrajectory=function(e){return unloadTrajectory(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r){var o=this,s,u,l=r!=null?r:[],c=[this.tileset.root],p=this.tileset.transform,f=(u=(s=e.params.Points)===null||s===void 0?void 0:s.threshold)!==null&&u!==void 0?u:0,d=e.hitFilter;e.hitFilter=function(T){var _;return Object.assign(T,{model:(_=o.parent)!==null&&_!==void 0?_:void 0,viewLayer:o}),d?d.call(e,T):!0};var h=e.sortByDistance;e.sortByDistance=!1;for(var m,A=1/0;m=c.pop();){var g=void 0;if(m.boundingVolume){var y=void 0;m.boundingVolume instanceof BoxBoundingVolume?y=scratchBoxBoundingVolume.copy(m.boundingVolume):m.boundingVolume instanceof SphereBoundingVolume?y=scratchSphereBoundingVolume.copy(m.boundingVolume):y=m.boundingVolume.clone(),y.applyMatrix4(p),g=y.intersectRay(e.ray,f,A)}else g=!0;if(g){for(var v=0,E=m.children.length;v<E;v++)c.push(m.children[v]);if(m.selected&&m.content&&m.content.data&&m.content.data.object.visible&&(m.content.data.object.intersectRaycaster(e,l),e.firstHitOnly)){var b=l[0];b&&A>b.distance&&(A=b.distance)}}}return e.hitFilter=d,e.sortByDistance=h,sortIntersects(l,e.sortByDistance,e.firstHitOnly),l},t.prototype.update=function(e,r,o,s){var u,l,c=this,p,f,d,h,m;this.renderer=e,this.frameNumber++;var A=!1,g=this.parameter.resolveValue(o.parameter,s.parameter);parameterVersionMap.get(this)!==g.version&&(parameterVersionMap.set(this,g.version),A=!0);var y=g.maxLevelOfDetail;y=Math.max(y,0);var v=Math.min(g.minLevelOfDetail,y);(!this.visible||!this.loaded||!o.loaded)&&(y=Math.max(v,0));var E=g.minGeometricError,b=r.controllerMode;(b==="Panorama"||b==="VRPanorama"||b==="XRPanorama")&&g.modelAlpha<.1&&(E=g.panoramaMinGeometricError);var T=g.maxGeometricError;T=Math.max(E,T);var _={time:r.time,camera:{type:r.type,position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(r.up).applyQuaternion(r.quaternion),projectionMatrix:r.projectionMatrix.clone(),visible:r.visible,refine:r.refineModel},height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new CullingVolume().setFromCamera(r),minLevelOfDetail:v,maxLevelOfDetail:y,minGeometricError:E,maxGeometricError:T,skipLevelOfDetail:g.skipLevelOfDetail,mostDetail:g.mostDetail,loadSiblings:g.loadSiblings,cameraCulling:g.cameraCulling,maxMemoryUsage:g.maxMemoryUsage,maxRequests:g.maxRequests,requestOrder:g.requestOrder,maxScreenSpaceError:g.maxScreenSpaceError,memoryAdjustedOverflow:g.memoryAdjustedOverflow,memoryAdjustedScreenSpaceError:g.memoryAdjustedScreenSpaceError},S=g.cacheCameras.map(function(re){return re.updateProjectionMatrix(),__assign(__assign({},_),{camera:{type:r.type,position:new THREE__namespace.Vector3().copy(re.position),direction:re.getWorldDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(re.up),projectionMatrix:re.projectionMatrix.clone(),visible:re.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(re)})});this.updateWorldMatrix(!0,!1),this.tileset.transform.equals(this.matrixWorld)||(this.tileset.transform.copy(this.matrixWorld),A=!0);var R=!this.autoRefine;if(R===!1){var w=g.progress>.01&&g.progress<.99;if(w){var M=new THREE__namespace.Vector3;g.pano0&&M.setFromMatrixPosition(g.pano0.matrix);var B=M.clone();g.pano1&&B.setFromMatrixPosition(g.pano1.matrix),M.distanceTo(B)<10&&(R=!0)}}if(R||this.tileset.update(_,S),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(re){if(c.refineProgress[1]++,re.content){var se=re.content.loadState;if(se==="UNLOADED"||se==="LOADING"){c.refined=!1;return}}c.refineProgress[0]++}),this.loaded===!1&&this.autoRefine){this.loaded=!0;var C=!1;this.tileset.needsRefinedTiles.forEach(function(re){if(c.loaded!==!1&&re.content){if(re.state.visible&&(C=!0),_.skipLevelOfDetail){if(re.state.finalResolution){var se=re.state.ancestorWithContentAvailable,he=se&&se.content?se.content:re.content,me=he.loadState;(me==="UNLOADED"||me==="LOADING")&&(c.loaded=!1)}}else if(re.state.visible&&re.levelOfContent<=0){var me=re.content.loadState;(me==="UNLOADED"||me==="LOADING")&&(c.loaded=!1)}}}),C&&this.tileset.selectedTiles.length===0&&this.tileset.frameNumber<500&&(this.loaded=!1),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)}this.renderObjects.length=0,this.backfaceObjects.length=0,this.tileObjects.length=0,this.remove.apply(this,this.children),_.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(re,se){return re.floor!==se.floor?re.floor-se.floor:re.levelOfContent!==se.levelOfContent?se.levelOfContent-re.levelOfContent:re.state.distanceToCamera!==se.state.distanceToCamera?re.state.distanceToCamera-se.state.distanceToCamera:re.state.centerZDepth-se.state.centerZDepth});for(var P=[],L=0,O=this.tileset.selectedTiles;L<O.length;L++){var F=O[L],N=(f=(p=F.content)===null||p===void 0?void 0:p.data)===null||f===void 0?void 0:f.object;if(N){var D=N.update(e,r,o,this,F,g);if(P.push(F.id),D&&(A=!0),this.tileset.hasMixedContent&&_.skipLevelOfDetail){if(!F.state.finalResolution){var U=cloneSkipBackfaceObject(N);U.name="skipBackface:"+N.name,this.backfaceObjects.push(U)}for(var z=F.state.selectionDepth,K=STENCIL_CONSTANT.TILE_MASK|z<<STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT,j=THREE__namespace.GreaterEqualStencilFunc,Q=STENCIL_CONSTANT.SKIP_LOD_MASK,V=THREE__namespace.ReplaceStencilOp,J=STENCIL_CONSTANT.TILE_MASK|STENCIL_CONSTANT.SKIP_LOD_MASK,W=0,X=N.materials;W<X.length;W++){var Z=X[W];Z.stencilWrite=!0,Z.stencilRef=K,Z.stencilFunc=j,Z.stencilFuncMask=Q,Z.stencilZPass=V,Z.stencilWriteMask=J}}else for(var Y=0,G=N.materials;Y<G.length;Y++){var Z=G[Y];Z.stencilWrite=!1,Z.stencilRef=STENCIL_CONSTANT.TILE_MASK,Z.stencilFunc=THREE__namespace.AlwaysStencilFunc,Z.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,Z.stencilZPass=THREE__namespace.ReplaceStencilOp,Z.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK}this.tileObjects.push(N)}}var ee=P.toString();tileVersionMap.get(this)!==ee&&(tileVersionMap.set(this,ee),A=!0),_.skipLevelOfDetail&&this.backfaceObjects.length&&(u=this.renderObjects).push.apply(u,this.backfaceObjects),this.tileObjects.length&&(l=this.renderObjects).push.apply(l,this.tileObjects),_.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var te=[],ne=0,ae=this.tileset.selectedTrajectories;ne<ae.length;ne++){var ce=ae[ne],ie=(d=ce.content.data)===null||d===void 0?void 0:d.object;if(ie){var D=ie.update(e,r,o,this,ce,g);te.push(ce.id),D&&(A=!0),this.renderObjects.push(ie)}}var fe=te.toString();trajectoryVersionMap.get(this)!==fe&&(trajectoryVersionMap.set(this,fe),A=!0);for(var ge=Math.min(0,((m=(h=this.parent)===null||h===void 0?void 0:h.children)!==null&&m!==void 0?m:[]).indexOf(this)),ye=ge*1e4,_e=function(re){var se=le.renderObjects[re],he=re+ye;se.traverse(function(me){(me instanceof THREE__namespace.Mesh||me instanceof THREE__namespace.Line||me instanceof THREE__namespace.Points)&&(me.renderOrder=he)}),le.add(se)},le=this,de=0;de<this.renderObjects.length;de++)_e(de);return A},t.prototype.dispose=function(){this.disposed=!0,this.tileset.reset(),this.tileset.root.children.length=0,/^blob\:/.test(this.tileset.id)&&URL.revokeObjectURL(this.tileset.id),this.remove.apply(this,this.children),this.refined=!1,this.loaded=!1,this.refineProgress[0]=this.refineProgress[1]=0,this.error=null,this.onError=void 0,this.renderer=void 0},Object.defineProperty(t.prototype,"model",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayer",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.enuToEcef=function(e){return e.applyMatrix4(this.enuToEcefMatrix)},t.prototype.ecefToEnu=function(e){return e.applyMatrix4(this.ecefToEnuMatrix)},t.prototype.localToEcef=function(e){return this.enuToEcef(this.localToEnu(e))},t.prototype.ecefToLocal=function(e){return this.enuToLocal(this.ecefToEnu(e))},t.prototype.localToLla=function(e){return ecefToLla(this.enuToEcef(this.localToEnu(e)))},t.prototype.llaToLocal=function(e){return this.enuToLocal(this.ecefToEnu(llaToEcef(e)))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},Object.defineProperty(t.prototype,"coordinates",{get:function(){scratchVector3$6.setScalar(0);var e=this.localToLla(scratchVector3$6),r=e.x,o=e.y;return[r,o].map(function(s){return(s/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),t.prototype.getTransformMatrix4=function(e){return e===void 0&&(e=new THREE__namespace.Matrix4),e.copy(this.ecefToEnuMatrix),e.premultiply(enuToLocalMatrix),e.premultiply(this.matrixWorld),e},t.prototype.coordinatesToWorldPoint=function(e){var r=new THREE__namespace.Vector3(e.latitude,e.longitude,e.altitude);return this.llaToWorld(r)},t.prototype.worldPointToCoordinates=function(e){return scratchVector3$6.copy(e),this.worldToLla(scratchVector3$6),{latitude:scratchVector3$6.x,longitude:scratchVector3$6.y,altitude:scratchVector3$6.z}},t.prototype.resetBrightness=function(){this.parameter.reset("brightness")},Object.defineProperty(t.prototype,"minLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minLevelOfDetail},set:function(e){this.parameter.set("minLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxLevelOfDetail},set:function(e){this.parameter.set("maxLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minGeometricError},set:function(e){this.parameter.set("minGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxGeometricError},set:function(e){this.parameter.set("maxGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoramaMinGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).panoramaMinGeometricError},set:function(e){this.parameter.set("panoramaMinGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).skipLevelOfDetail},set:function(e){this.parameter.set("skipLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).mostDetail},set:function(e){this.parameter.set("mostDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).loadSiblings},set:function(e){this.parameter.set("loadSiblings",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxMemoryUsage},set:function(e){this.parameter.set("maxMemoryUsage",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxRequests},set:function(e){this.parameter.set("maxRequests",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).requestOrder},set:function(e){this.parameter.set("requestOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxScreenSpaceError},set:function(e){this.parameter.set("maxScreenSpaceError",e)},enumerable:!1,configurable:!0}),t})(THREE__namespace.Object3D),fetcherMap=new WeakMap;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var scratchVector3$5=new THREE__namespace.Vector3,scratchMatrix4$2=new THREE__namespace.Matrix4;function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":e.identity();break;case"Y":e.fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);break;case"-Y":e.fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}function loadViewLayer(n,t){var e,r=n.tileset,o=n.name,s=n.type,u=n.work.getURL(r),l=u.split("#"),c=l[0],p=l[1],f=(e=(p||c).split("?")[1])!==null&&e!==void 0?e:"";return t.fetcher.ajax(u,{responseType:"text"}).catch(function(d){return{error:d,body:JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}})}}).then(function(d){var h,m="error"in d?d.error:null,A=normalizeTilesetHeader(JSON.parse(d.body),u),g=A.root,y=A.rootMeta,v=y===void 0?{}:y,E=n.upAxis;v.upAxis&&v.upAxis!==E&&(E=v.upAxis),"lodVersion"in A&&(E="-Y","floorInfo"in A&&(A.properties=A.properties||{},A.properties.floorInfo=A.floorInfo.map(function(w){return{ground:-w.ground,height:w.height}}),A.floorInfo=void 0),A.asset.tilesetVersion=String(A.lodVersion),A.lodVersion=void 0);var b=g.boundingVolume?makeBoundingVolume(g.boundingVolume):void 0;b&&g.transform&&b.applyMatrix4(scratchMatrix4$2.fromArray(g.transform));var T=null,_=new THREE__namespace.Matrix4,S=new THREE__namespace.Matrix4;v.coordinate?(T=v.coordinate.ground_height,_.fromArray(v.coordinate.pose_ecef_to_enu),S.fromArray(v.coordinate.pose_enu_to_ecef)):(b?b.getCenter(scratchVector3$5):scratchVector3$5.setScalar(0),getEcefToEnuMatrixFromUpAxis(E,scratchVector3$5,_),S.getInverse(_)),A.root={refine:(h=g.refine)!==null&&h!==void 0?h:"REPLACE",geometricError:g.geometricError,transform:scratchMatrix4$2.copy(_).premultiply(enuToLocalMatrix).toArray(),boundingVolume:b?b.toJson():void 0,children:[g]};var R=new Tile3D(A,{name:o,type:s,upAxis:E,light:t.light,fetcher:t.fetcher,search:f,groundHeight:T,enuToEcefMatrix:S,ecefToEnuMatrix:_,error:m});return R})}function loadViewLayers(n,t){var e,r,o=n.layers.slice();if(n.file){for(var s=!1,u=0,l=o;u<l.length;u++){var c=l[u];if(c.type==="mesh"){s=!0;break}}if(s===!1){var p=getExt(n.file)||"at3d",f=JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],content:{uri:n.work.getURL(n.file)},extras:(e={},e[p]={textureBaseUri:typeof n.textureBase=="string"?n.work.getURL(n.textureBase):void 0,textureArray:n.textures,textureOptions:(r=t.textureOptions)!==null&&r!==void 0?r:{}},e)}});o.push({work:n.work,name:"fallback",type:"mesh",upAxis:"Z",tileset:URL.createObjectURL(new Blob([f],{type:"application/json"}))})}}return o.map(function(d){return loadViewLayer(d,{fetcher:t.fetcher,light:t.light}).then(function(h){return t.onError&&(h.error&&t.onError(h.error),h.onError=t.onError),h})})}function createSimpleBoxBufferGeometry(n,t,e){n===void 0&&(n=1),t===void 0&&(t=1),e===void 0&&(e=1);var r=n/2,o=t/2,s=e/2,u=new Float32Array([-r,+o,+s,+r,+o,+s,+r,+o,-s,-r,+o,-s,-r,-o,+s,+r,-o,+s,+r,-o,-s,-r,-o,-s]),l=new Uint32Array([0,4,1,1,4,5,1,5,2,2,5,6,2,6,3,3,6,7,3,7,0,0,7,4,3,0,2,2,0,1,4,7,5,5,7,6]),c=new THREE__namespace.BufferGeometry;return c.setAttribute("position",new THREE__namespace.BufferAttribute(u,3)),c.setIndex(new THREE__namespace.BufferAttribute(l,1)),c.addGroup(0,c.index.count,0),c.computeBoundingBox(),c.computeBoundingSphere(),c}function mergeBufferGeometries(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),o=new Set(Object.keys(n[0].morphAttributes)),s={},u={},l=new THREE__namespace.BufferGeometry,c=0;c<n.length;++c){var p=n[c];if(e!==(p.index!==null))return null;for(var f in p.attributes){if(!r.has(f))return null;s[f]===void 0&&(s[f]=[]),s[f].push(p.attributes[f])}for(var f in p.morphAttributes){if(!o.has(f))return null;u[f]===void 0&&(u[f]=[]),u[f].push(p.morphAttributes[f])}l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(p.userData)}if(e){for(var d=0,h=[],c=0;c<n.length;++c){for(var m=n[c].index,A=0;A<m.count;++A)h.push(m.getX(A)+d);d+=n[c].attributes.position.count}l.setIndex(h)}for(var f in s){var g=mergeBufferAttributes(s[f]);if(!g)return null;l.setAttribute(f,g)}for(var f in u){var y=u[f][0].length;if(y===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[f]=[];for(var c=0;c<y;++c){for(var v=[],A=0;A<u[f].length;++A)v.push(u[f][A][c]);var E=mergeBufferAttributes(v);if(!E)return null;l.morphAttributes[f].push(E)}}return l}function mergeBufferAttributes(n){for(var t,e,r,o=0,s=0;s<n.length;++s){var u=n[s];if(u.isInterleavedBufferAttribute||(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)||(e===void 0&&(e=u.itemSize),e!==u.itemSize)||(r===void 0&&(r=u.normalized),r!==u.normalized))return null;o+=u.array.length}for(var l=new t(o),c=0,s=0;s<n.length;++s)l.set(n[s].array,c),c+=n[s].array.length;return new THREE__namespace.BufferAttribute(l,e,r)}function mergeVertices(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),o=n.getAttribute("position"),s=r?r.count:o.count,u=0,l=Object.keys(n.attributes),c={},p={},f=[],d=["getX","getY","getZ","getW"],h=0,m=l.length;h<m;h++){var A=l[h];c[A]=[];var g=n.morphAttributes[A];g&&(p[A]=new Array(g.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),v=Math.pow(10,y),h=0;h<s;h++){for(var E=r?r.getX(h):h,b="",T=0,m=l.length;T<m;T++)for(var A=l[T],_=n.getAttribute(A),S=_.itemSize,R=0;R<S;R++)b+="".concat(~~(_[d[R]](E)*v),",");if(b in e)f.push(e[b]);else{for(var T=0,m=l.length;T<m;T++)for(var A=l[T],_=n.getAttribute(A),g=n.morphAttributes[A],S=_.itemSize,w=c[A],M=p[A],R=0;R<S;R++){var B=d[R];if(w.push(_[B](E)),g)for(var C=0,P=g.length;C<P;C++)M[C].push(g[C][B](E))}e[b]=u,f.push(u),u++}}for(var L=n.clone(),h=0,m=l.length;h<m;h++){var A=l[h],O=n.getAttribute(A),F=new O.array.constructor(c[A]),_=new THREE__namespace.BufferAttribute(F,O.itemSize,O.normalized);if(L.setAttribute(A,_),A in p)for(var T=0;T<p[A].length;T++){var N=n.morphAttributes[A][T],F=new N.array.constructor(p[A][T]),D=new THREE__namespace.BufferAttribute(F,N.itemSize,N.normalized);L.morphAttributes[A][T]=D}}return L.setIndex(f),L}var scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4$1=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4;function getEdgesBySphere(n,t,e){e===void 0&&(e=30/180*Math.PI);for(var r=Math.cos(e),o=[],s=0,u=n.children;s<u.length;s++){var l=u[s];l instanceof Tile3D&&l.tileset.selectedTiles.forEach(function(c){var p,f,d,h=(f=(p=c.content)===null||p===void 0?void 0:p.data)===null||f===void 0?void 0:f.object;if(h&&h.visible){var m=[];if(h.traverseVisible(function(j){if(j instanceof THREE__namespace.Mesh){var Q=getBvhTreeForMesh(j);if(Q){scratchMatrix4$1.copy(j.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4$1),scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);var V=Q.trianglesInSphere(scratchSphere$1.center,scratchSphere$1.radius),J=new THREE__namespace.BufferGeometry;J.setAttribute("position",new THREE__namespace.BufferAttribute(V,3)),J.applyMatrix4(j.matrixWorld),J=mergeVertices(J,.01),m.push(J)}}}),m.length===0)return;for(var A=["a","b","c"],g=mergeBufferGeometries(m),y=g.getAttribute("position").array,v=((d=g.getIndex())===null||d===void 0?void 0:d.array)||[],E=[],b=[],T=0,_=y.length;T<_;T+=3){var S=new THREE__namespace.Vector3(y[T],y[T+1],y[T+2]);E.push(S)}for(var T=0,_=v.length;T<_;T+=3){var R=v[T],w=v[T+1],M=v[T+2],B=new THREE__namespace.Vector3().crossVectors(E[w].clone().sub(E[R]),E[M].clone().sub(E[R])).normalize();b.push({a:R,b:w,c:M,normal:B})}for(var C={},T=0,_=b.length;T<_;T++)for(var P=b[T],L=0;L<3;L++){var O=P[A[L]],F=P[A[(L+1)%3]],N=[Math.min(O,F),Math.max(O,F)],D=N[0]+"-"+N[1];C[D]===void 0?C[D]={index1:N[0],index2:N[1],face1:T}:C[D].face2=T}for(var D in C){var U=C[D];if(U.face2===void 0||b[U.face1].normal.dot(b[U.face2].normal)<=r){var z=E[U.index1],K=E[U.index2];o.push(new THREE__namespace.Line3(z,K))}}E.length=0,b.length=0}})}return o}var scratchBoundingBox$1=new THREE__namespace.Box3,scratchViewLayerBox=new THREE__namespace.Box3,scratchObserverBox$3=new THREE__namespace.Box3,Model=(function(n){__extends(t,n);function t(e,r){r===void 0&&(r={});var o,s=n.call(this)||this;s.disposed=!1,s.parameter=new Parameter,s.outdated=!1,s.autoRefine=!0,s.metaPending=!1,s.loaded=!1,s.refined=!1,s.refineProgress=[0,0],s.boundingBox=new THREE__namespace.Box3,s.needsRender=!1,s.work=e,s.name=s.work.workCode;for(var u=0,l=0,c=e.observers;l<c.length;l++){var p=c[l];u=Math.max(u,p.floorIndex)}if(s.floorLength=u+1,e.model){s.metaPending=!0;var f=loadViewLayers(e.model,{fetcher:getFetcher(e),light:(o=r.light)!==null&&o!==void 0?o:!1,textureOptions:r.textureOptions,onError:function(d){return s.dispatchEvent({type:"error",error:d})}});s.initReady=Promise.all(f).then(function(d){if(s.metaPending=!1,d.length)if(s.disposed)for(var h=0,m=d;h<m.length;h++){var A=m[h];A.dispose()}else s.add.apply(s,d)}),s.loadedReady=new Promise(function(d){var h=function(){d(),s.removeEventListener("load",h),s.removeEventListener("dispose",h)};s.addEventListener("load",h),s.addEventListener("dispose",h)})}else s.refined=!0,s.loaded=!0,s.initReady=Promise.resolve(),s.loadedReady=Promise.resolve();return s.parameter.set("boundingBox",s.boundingBox.clone()),s}return t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)typeof e.dispose=="function"&&e.dispose(),this.remove(e);this.dispatchEvent({type:"dispose"})},Object.defineProperty(t.prototype,"empty",{get:function(){return this.children.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayers",{get:function(){return this.children},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){return r===void 0&&(r=30/180*Math.PI),getEdgesBySphere(this,e,r)},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=e.sortByDistance;e.sortByDistance=!1;for(var u=0,l=this.children.length;u<l;u++){var c=this.children[u];c.visible&&typeof c.intersectRaycaster=="function"&&c.intersectRaycaster(e,o)}return e.sortByDistance=s,sortIntersects(o,e.sortByDistance,e.firstHitOnly),o},t.prototype.update=function(e,r,o){var s=!1;this.needsRender===!0&&(this.needsRender=!1,s=!0);var u=this.loaded;this.refined=!this.metaPending,this.loaded=!this.metaPending,this.refineProgress[0]=this.refineProgress[1]=0,this.work.transform.equals(this.matrix)||(this.matrix.copy(this.work.transform),this.matrix.decompose(this.position,this.quaternion,this.scale),this.matrixAutoUpdate=!1,s=!0);for(var l=0,c=this.children;l<c.length;l++){var p=c[l];p.autoRefine=this.autoRefine;var f=p.update(e,r,o,this);f&&(s=!0),p.refined===!1&&(this.refined=!1),p.loaded===!1&&(this.loaded=!1),this.refineProgress[0]+=p.refineProgress[0],this.refineProgress[1]+=p.refineProgress[1]}scratchBoundingBox$1.makeEmpty(),scratchObserverBox$3.copy(this.work.observerBox),scratchObserverBox$3.isEmpty()||(scratchObserverBox$3.max.x+=1,scratchObserverBox$3.max.z+=1,scratchObserverBox$3.max.y+=1,scratchObserverBox$3.min.x-=1,scratchObserverBox$3.min.z-=1,scratchBoundingBox$1.union(scratchObserverBox$3));for(var d=0,h=this.viewLayers;d<h.length;d++){var p=h[d];p.boundingBox.isEmpty()||(scratchViewLayerBox.copy(p.boundingBox),scratchBoundingBox$1.union(scratchViewLayerBox))}return scratchBoundingBox$1.applyMatrix4(this.matrix),scratchBoundingBox$1.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox$1),this.parameter.set("boundingBox",scratchBoundingBox$1.clone())),u===!1&&this.loaded===!0&&this.dispatchEvent({type:"load"}),s},t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null,this.dispatchEvent({type:"changeShownFloor",shownFloor:e})},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r)},Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).shownFloorIndex},set:function(e){this.parameter.set("shownFloorIndex",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).brightness},set:function(e){this.parameter.set("brightness",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clippers",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).clippers},set:function(e){this.parameter.set("clippers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).customShaders},set:function(e){this.parameter.set("customShaders",e)},enumerable:!1,configurable:!0}),t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.viewLayers;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Object3D),scratchBoundingBox3=new THREE__namespace.Box3,scratchModelBoundingBox3=new THREE__namespace.Box3,ModelScene=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.needsRender=!0,e.autoRefine=!0,e.boundingBox=new THREE__namespace.Box3,e.loaded=!1,e.refined=!1,e.refineProgress=[0,0],e.parameter=new Parameter;var r=e.models=[];e.parameter.set("boundingBox",e.boundingBox.clone());var o=e;return defineProperty(r,"autoUpdate",{get:function(){return o.autoRefine},set:function(s){o.autoRefine=s}}),defineProperty(r,"bounding",{get:function(){return o.boundingBox}}),defineProperty(r,"loaded",{get:function(){return o.loaded}}),defineProperty(r,"refined",{get:function(){return o.refined}}),defineProperty(r,"refineProgress",{get:function(){return o.refineProgress}}),defineProperty(r,"cacheCameras",{get:function(){return o.parameter.resolveValue().cacheCameras},set:function(s){o.parameter.set("cacheCameras",s)}}),defineProperty(r,"intersectRaycaster",{value:function(s){return o.intersectRaycaster(s)}}),defineProperty(r,"setMaterial",{value:function(s){return o.setMaterial(s)}}),defineProperty(r,"getMaterial",{value:function(){return o.getMaterial()}}),defineProperty(r,"resetBrightness",{value:function(){return o.resetBrightness()}}),e}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.add.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}return this.needsRender=!0,this},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.remove.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}scratchBoundingBox3.makeEmpty();for(var l=0,c=this.children;l<c.length;l++){var u=c[l];u instanceof Model&&(scratchModelBoundingBox3.copy(u.boundingBox).applyMatrix4(u.matrix),scratchBoundingBox3.union(scratchModelBoundingBox3))}return this.boundingBox.copy(scratchBoundingBox3),this.needsRender=!0,this},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=this.children.filter(function(f){return f instanceof Model});if(s.length===1)s[0].intersectRaycaster(e,o);else{var u=e.sortByDistance;e.sortByDistance=!1;for(var l=0,c=s;l<c.length;l++){var p=c[l];p.visible&&p.intersectRaycaster(e,o)}e.sortByDistance=u,sortIntersects(o,e.sortByDistance,e.firstHitOnly)}return o},t.prototype.update=function(e,r){var o=!1;scratchBoundingBox3.makeEmpty(),this.loaded=this.models.length>0,this.refined=this.models.length>0,this.refineProgress[0]=this.refineProgress[1]=0,this.models.length=0;for(var s=0,u=this.children;s<u.length;s++){var l=u[s];if(l instanceof Model)if(l.outdated){l.autoRefine=!1;var c=l.update(e,r,this);c&&(o=!0)}else{this.models.push(l),l.autoRefine=this.autoRefine;var c=l.update(e,r,this);c&&(o=!0),l.loaded===!1&&(this.loaded=!1),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],scratchModelBoundingBox3.copy(l.boundingBox),scratchBoundingBox3.union(scratchModelBoundingBox3)}else if(l.update){var c=l.update(e,r,this);c&&(o=!0)}}return scratchBoundingBox3.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox3),this.parameter.set("boundingBox",scratchBoundingBox3.clone())),this.needsRender=o,o},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.models;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Scene);function workInitialToJson(n){var t={};return typeof n.mode!="undefined"&&(t.mode=n.mode),typeof n.panoIndex!="undefined"&&(t.pano_index=n.panoIndex),typeof n.longitude!="undefined"&&(t.longitude=n.longitude),typeof n.latitude!="undefined"&&(t.latitude=n.latitude),typeof n.fov!="undefined"&&(t.fov=n.fov),typeof n.distance!="undefined"&&(t.distance=n.distance),typeof n.offset!="undefined"&&(t.offset=n.offset.toArray()),t}function workModelToJson(n){var t;if(n)return{file_url:n.file,material_base_url:n.textureBase,material_textures:(t=n.textures)===null||t===void 0?void 0:t.slice(),layers:n.layers.map(function(e){return{tileset_url:e.tileset,up_axis:e.upAxis,name:e.name,type:e.type}})}}function workObserverToObserverJson(n){return{index:n.index,floor_index:n.floorIndex,position:n.position.toArray(),standing_position:n.standingPosition.toArray(),quaternion:{x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w},visible_nodes:n.visibleNodes.slice(),accessible_nodes:n.accessibleNodes.slice()}}function workObserverToPanoramaJson(n){return{index:n.index,active:n.active,loadable:n.loadable,derived_id:n.derivedId,derived_id_str:n.derivedIdStr,size_list:n.images.sizeList.slice(),up:n.images.up,down:n.images.down,right:n.images.right,left:n.images.left,front:n.images.front,back:n.images.back,video:n.video?{matrix:n.video.matrix.toArray(),size:n.video.size.toArray(),source:n.video.source}:void 0}}function workToJson(n){return{allow_hosts:n.allowHosts.slice(),expire_at:n.expire.getTime().toString(),project_id:n.projectId,code:n.workCode,name:n.name,base_url:n.baseURL,initial:workInitialToJson(n.initial),model:workModelToJson(n.model),observers:n.observers.map(function(t){return workObserverToObserverJson(t)}),panorama:{count:n.observers.length,list:n.observers.map(function(t){return workObserverToPanoramaJson(t)})}}}function isNumber(n){return typeof n=="number"}function jsonClone(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(function(o){return typeof o!="object"||o===null?o:jsonClone(o)});var t={};for(var e in n){var r=n[e];t[e]=typeof r!="object"||r===null?r:jsonClone(r)}return t}function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function jsonMerge(n,t){var e=getType(n),r=getType(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return jsonClone(t);if(r==="array")for(var o=0;o<t.length;o++)n[o]=jsonMerge(n[o],t[o]);else if(r==="dict")for(var s in t)n[s]=jsonMerge(n[s],t[s]);return n}function jsonStableStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],p=jsonStableStrinfiy_(n[c],!0);p!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+p),s++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function jsonStableStrinfiy(n){return jsonStableStrinfiy_(n,!1)}function jsonHash(n){return"hash::".concat(sha256(jsonStableStrinfiy(n)))}var PANO_ID_REG=/^(.*)\[(\d+)\]$/;function panoStringify(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function panoParse(n){var t=n.match(PANO_ID_REG);if(t){t[0];var e=t[1],r=t[2],o=Math.floor(Number(r));if(!isNaN(o)&&isFinite(o))return{workCode:e,panoIndex:o}}throw new Error("Invalid PanoId")}function panoEqual(n,t){return panoStringify(n)===panoStringify(t)}function isPanoId(n){return typeof n=="string"&&PANO_ID_REG.test(n)}function deepFreeze(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&deepFreeze(n[r])}),n}var URL_REGEXP=/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i,BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse((function n(){var t=113,e=126,r=0,o="";return arguments[r].split(o).map(function(s){return s.charCodeAt(r)>e?s:String.fromCharCode((s.charCodeAt(r)+t)%e)}).join(o)})("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/rnyrr;p{/9/rnyrr;p|z/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"))),domainRegex=/^([^.]+)(\.([^.]+))*$/,currentHostname=typeof location!="undefined"?location.hostname:"localhost";function isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){if(!domainRegex.test(n)||!domainRegex.test(t))return!1;if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var o=0;o<e.length;o++)if(e[o]!==r[o])return!1;return!0}function hostnameFromURL(n){if(/^blob\:/i.test(n)||/^data\:/i.test(n))return currentHostname;var t=n.match(URL_REGEXP);return t?t[2]:currentHostname}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("Date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("Host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,o=Object.keys(n);r<o.length;r++){var s=o[r];t.indexOf(s)===-1&&(e[s]=n[s])}return e}function jsonStableNoneNumberStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableNoneNumberStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],p=jsonStableNoneNumberStrinfiy_(n[c],!0);p!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+p),s++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r,o={};try{o=typeof n=="string"?JSON.parse(n):n}catch(y){return error_invalid_input()}if(typeof o!="object")return error_invalid_input();var s=currentHostname,u=Date.now(),l=new Date(typeof o.expire_at=="string"&&/^\d+$/.test(o.expire_at)?Number(o.expire_at):o.expire_at),c=Array.isArray(o.allow_hosts)?o.allow_hosts:[];if(s.length===0||isIPDomain(s)||BUILDIN_ALLOW_HOST.filter(function(y){return matchDomain(y,s)}).length>0){var p=String((t=o.certificate)!==null&&t!==void 0?t:"");if(p)try{var f=new X509;return f.readCertPEM(p),deepFreeze({issuer:f.getSubjectString(),expire:l,allowHosts:c})}catch(y){var d=y instanceof Error?y.message:String(y);console.warn("[PARSE Error]: Invalid Certificate. "+d)}return deepFreeze({issuer:"none",expire:l,allowHosts:c})}var h=String((e=o.certificate)!==null&&e!==void 0?e:"");if(!h)return error_invalid_certificate();var m=new X509;m.readCertPEM(h);var A=String((r=o._signature)!==null&&r!==void 0?r:"");if(!A)return error_invalid_signature();var g=jsonStableNoneNumberStrinfiy(ObjectOmit(o,["_signature"]));return verifyMessage(g,A,m)===!1?error_invalid_signature():u<l.getTime()?BUILDIN_ALLOW_HOST.concat(c).filter(function(y){return matchDomain(y,s)}).length===0?error_host_not_allowed(s):deepFreeze({issuer:m.getSubjectString(),expire:l,allowHosts:c}):error_date_expired(l)}function verifyURL(n,t){var e=hostnameFromURL(n);return currentHostname.length!==0&&!isIPDomain(currentHostname)&&BUILDIN_ALLOW_HOST.filter(function(r){return matchDomain(r,currentHostname)}).length===0&&!isIPDomain(e)&&BUILDIN_ALLOW_HOST.concat(t).filter(function(r){return matchDomain(r,e)}).length===0?error_host_not_allowed(e):n}var PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(1,1,1),FACE_ORDER$1=["right","left","up","down","front","back"];function relativeURL(n,t){if(!isAbsoluteURL(n))return n;if(n.indexOf(t)===0)return n.slice(t.length);var e=t.replace(/^https\:/,"http:");if(n.indexOf(e)===0)return n.slice(e.length);var r=t.replace(/^http\:/,"https:");return n.indexOf(r)===0?n.slice(r.length):(console.warn("".concat(n," is not start with base_url(").concat(t,").")),n)}function panoURL(n,t,e){return!isAbsoluteURL(n)&&typeof t=="string"&&t.length>0&&(n=pathJoin(t,String(e),n)),n}function getTileLevel(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null}function sortTile(n){n=n.slice().sort(function(u,l){return u.level-l.level});for(var t=[],e=0,r=n;e<r.length;e++){var o=r[e];if(t.length===0){t.push(o);continue}var s=t[t.length-1];if(o.level>s.level){t.push(o);continue}if(o.size>s.size){t[t.length-1]=o;continue}}return t}function parse(n,t){for(var e,r,o,s,u,l,c,p,f,d,h,m,A,g,y,v,E,b=[],T=null,_=0,S=[].concat(n);_<S.length;_++){var R=S[_];if("getURL"in R)T={allowHosts:R.allowHosts,expire:R.expire,issuer:R.issuer},b.push(workToJson(R));else{var w=typeof R=="string"?JSON.parse(R):jsonClone(R),M=verify(w);if(M instanceof Error)return M;T===null&&(T=M),b.push(w)}}if(T===null)return new Error("Empty");defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:T.issuer}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(T.expire)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(T.allowHosts)});var B=b.reduce(function(V,J){return jsonMerge(V,J)});defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:String((e=B.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{enumerable:!0,writable:!0,value:String(B.resource_code||B.basic_code||B.vr_code||B.code||B.project_id||B.work_code||B.workCode||createUuid())}),defineProperty(t,"projectId",{enumerable:!0,writable:!0,value:B.project_id}),defineProperty(t,"baseURL",{enumerable:!0,writable:!0,value:(function(){var V,J=(V=B.base_url)!==null&&V!==void 0?V:"";return J&&J[J.length-1]!=="/"&&(J+="/"),J})()});var C=void 0;typeof B.model=="object"&&(C={},defineProperty(C,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(C,"file",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=B.model.file_url;if(V)return relativeURL(V,t.baseURL)})()}),defineProperty(C,"textureBase",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=B.model.material_base_url;return V&&(V=relativeURL(V,t.baseURL)),V})()}),defineProperty(C,"textures",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=void 0;return Array.isArray(B.model.material_textures)&&(V=B.model.material_textures.slice(),Object.freeze(V)),V})()}),defineProperty(C,"layers",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V,J,W,X=[];if(Array.isArray(B.model.layers))for(var Z=0,Y=B.model.layers;Z<Y.length;Z++){var G=Y[Z];if(G&&G.tileset_url){var ee={};defineProperty(ee,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(ee,"name",{enumerable:!0,configurable:!1,writable:!1,value:(V=G.name)!==null&&V!==void 0?V:""}),defineProperty(ee,"type",{enumerable:!0,configurable:!1,writable:!1,value:(J=G.type)!==null&&J!==void 0?J:"mesh"}),defineProperty(ee,"upAxis",{enumerable:!0,configurable:!1,writable:!1,value:(W=G.up_axis)!==null&&W!==void 0?W:"Z"}),defineProperty(ee,"tileset",{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(G.tileset_url,t.baseURL)}),X.push(ee)}}if(typeof B.model.tiles=="object"){var G=B.model.tiles;if(G&&G.tileset_url){var ee={};defineProperty(ee,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(ee,"name",{enumerable:!0,configurable:!1,writable:!1,value:"lod"}),defineProperty(ee,"type",{enumerable:!0,configurable:!1,writable:!1,value:"mesh"}),defineProperty(ee,"upAxis",{enumerable:!0,configurable:!1,writable:!1,value:"-Y"}),defineProperty(ee,"tileset",{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(G.tileset_url,t.baseURL)}),X.push(ee)}}return Object.freeze(X)})()})),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:C});var P=[];if(Array.isArray(B.observers)&&B.panorama&&Array.isArray(B.panorama.list||B.panorama.info))for(var L=B.observers,O=(r=B.panorama.list||B.panorama.info)!==null&&r!==void 0?r:[],F=(p=(l=(s=(o=B.panorama)===null||o===void 0?void 0:o.pano_high_cube_base_url)!==null&&s!==void 0?s:(u=B.panorama)===null||u===void 0?void 0:u.pano_cube_base_url)!==null&&l!==void 0?l:(c=B.panorama)===null||c===void 0?void 0:c.base_url)!==null&&p!==void 0?p:"",N=Math.min(L.length,O.length),D=function(V){var J=L[V],W=O[V],X={};defineProperty(X,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(X,"index",{enumerable:!0,configurable:!1,writable:!1,value:V}),defineProperty(X,"panoIndex",{enumerable:!0,configurable:!1,writable:!1,value:V}),defineProperty(X,"panoId",{enumerable:!0,configurable:!1,writable:!1,value:panoStringify({workCode:t.workCode,panoIndex:V})}),defineProperty(X,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:(f=J.derived_id)!==null&&f!==void 0?f:W.derived_id}),defineProperty(X,"floorIndex",{enumerable:!0,configurable:!1,writable:!1,value:(d=J.floor_index)!==null&&d!==void 0?d:J.floor}),defineProperty(X,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:(h=J.derived_id)!==null&&h!==void 0?h:W.derived_id}),defineProperty(X,"derivedIdStr",{enumerable:!0,configurable:!1,writable:!1,value:(m=J.derived_id_str)!==null&&m!==void 0?m:W.derived_id_str}),defineProperty(X,"active",{enumerable:!0,configurable:!1,writable:!1,value:J.active!==!1&&W.active!==!1}),defineProperty(X,"loadable",{enumerable:!0,configurable:!1,writable:!1,value:(g=(A=J.active)!==null&&A!==void 0?A:W.active)!==null&&g!==void 0?g:!1}),defineProperty(X,"position",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((y=J.position)!==null&&y!==void 0?y:[0,0,0]))}),defineProperty(X,"standingPosition",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((E=(v=J.standing_position)!==null&&v!==void 0?v:J.standingPosition)!==null&&E!==void 0?E:[0,0,0]))}),defineProperty(X,"quaternion",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Quaternion().fromArray(J.quaternion?[J.quaternion.x,J.quaternion.y,J.quaternion.z,J.quaternion.w]:[0,0,0,1]))}),defineProperty(X,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Matrix4().compose(X.position,X.quaternion,PANO_TEXTURE_SCALE))}),defineProperty(X,"accessibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z,Y,G=((Y=(Z=J.accessible_nodes)!==null&&Z!==void 0?Z:J.accessibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(te){return te<N});if(G.length===0)for(var ee=0;ee<N;ee++)ee!==V&&G.push(ee);return Object.freeze(G)})()}),defineProperty(X,"visibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z,Y,G=((Y=(Z=J.visible_nodes)!==null&&Z!==void 0?Z:J.visibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(te){return te<N});if(G.length===0)for(var ee=0;ee<N;ee++)ee!==V&&G.push(ee);return Object.freeze(G)})()}),defineProperty(X,"images",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z={};defineProperty(Z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var Y=0,G=FACE_ORDER$1;Y<G.length;Y++){var ee=G[Y];defineProperty(Z,ee,{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(panoURL(W[ee],F,V),t.baseURL)})}return defineProperty(Z,"sizeList",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var te=getImageSizeFromURL(Z[FACE_ORDER$1[0]]);if(te){if(W.size_list){var ne=W.size_list.slice().sort(function(ye,_e){return ye-_e});return Object.freeze(ne)}else if(W.tiles){for(var ne=[te],ae=W.tiles.slice().sort(function(_e,le){return _e-le}),ce=0,ie=ae;ce<ie.length;ce++){var fe=ie[ce],ge=512*Math.pow(2,fe);ge>te&&ne.push(ge)}return Object.freeze(ne)}}return Object.freeze([])})()}),defineProperty(Z,"tiles",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var te=getImageSizeFromURL(Z.front);if(te){var ne=Z.sizeList.slice();if(ne[0]){var ae=getTileLevel(ne[0]);if(ae)for(var ce=ae-1;ce>=0;ce--)ne.unshift(512*Math.pow(2,ce))}if(!(ne.length<=0)){for(var ie=[],fe=0,ge=ne;fe<ge.length;fe++){var ye=ge[fe],_e=getTileLevel(ye);if(typeof _e=="number"){var le={};if(defineProperty(le,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(le,"level",{enumerable:!0,configurable:!1,writable:!1,value:_e}),ye>te){defineProperty(le,"size",{enumerable:!0,configurable:!1,writable:!1,value:ye}),defineProperty(le,"scale",{enumerable:!0,configurable:!1,writable:!1,value:1});for(var de=0,re=FACE_ORDER$1;de<re.length;de++){var se=re[de];defineProperty(le,se,{enumerable:!0,configurable:!1,writable:!1,value:replaceImageSize(Z[se],ye)})}}else{defineProperty(le,"size",{enumerable:!0,configurable:!1,writable:!1,value:te}),defineProperty(le,"scale",{enumerable:!0,configurable:!1,writable:!1,value:ye/te});for(var he=0,me=FACE_ORDER$1;he<me.length;he++){var se=me[he];defineProperty(le,se,{enumerable:!0,configurable:!1,writable:!1,value:Z[se]})}}ie.push(le)}}return ie=sortTile(ie),Object.freeze(ie)}}})()}),Z})()}),defineProperty(X,"video",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z=void 0;return W.video&&(Z={},defineProperty(Z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Z,"source",{enumerable:!0,configurable:!1,writable:!1,value:W.video.source}),defineProperty(Z,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().fromArray(W.video.matrix)}),defineProperty(Z,"size",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector2().fromArray(W.video.size)})),Z})()}),P.push(X)},U=0;U<N;U++)D(U);defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(P)});var z={};if(defineProperty(z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),B.initial){if(t.observers.length>0){var K=void 0;isNumber(B.initial.panoIndex)?K=B.initial.panoIndex:isNumber(B.initial.pano_index)?K=B.initial.pano_index:isNumber(B.initial.pano)&&(K=B.initial.pano),typeof K=="number"&&(K=clamp$1(K,0,t.observers.length-1),defineProperty(z,"panoIndex",{enumerable:!0,writable:!0,value:K}))}if(B.initial.mode==="Panorama"&&t.observers.length===0||B.initial.mode==="Floorplan"||B.initial.mode==="Topview"||B.initial.mode==="Model"||B.initial.mode==="Mapview"?defineProperty(z,"mode",{enumerable:!0,writable:!0,value:B.initial.mode}):typeof z.panoIndex=="number"?defineProperty(z,"mode",{enumerable:!0,writable:!0,value:"Panorama"}):defineProperty(z,"mode",{enumerable:!0,writable:!0,value:"Mapview"}),isNumber(B.initial.latitude)&&defineProperty(z,"latitude",{enumerable:!0,writable:!0,value:B.initial.latitude}),isNumber(B.initial.longitude)?defineProperty(z,"longitude",{enumerable:!0,writable:!0,value:B.initial.longitude}):isNumber(B.initial.heading)&&defineProperty(z,"longitude",{enumerable:!0,writable:!0,value:headingToLongitude(B.initial.heading)}),isNumber(B.initial.fov)&&defineProperty(z,"fov",{enumerable:!0,writable:!0,value:B.initial.fov}),isNumber(B.initial.distance)&&defineProperty(z,"distance",{enumerable:!0,writable:!0,value:B.initial.distance}),Array.isArray(B.initial.offset)){var j=B.initial.offset,Q=[0,0,0].map(function(V,J){var W=Number(j[J]);return isNaN(W)||!isFinite(W)?0:W});defineProperty(z,"offset",{enumerable:!0,writable:!0,value:new THREE__namespace.Vector3().fromArray(Q)})}else typeof B.initial.offset=="object"&&typeof B.initial.offset.x=="number"&&typeof B.initial.offset.y=="number"&&typeof B.initial.offset.z=="number"&&defineProperty(z,"offset",{enumerable:!0,writable:!0,value:new THREE__namespace.Vector3().fromArray([B.initial.offset.x,B.initial.offset.y,B.initial.offset.z])})}return defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:z}),t}function parseNull(n,t){return defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:"Null"}),defineProperty(t,"workCode",{enumerable:!0,value:createUuid()}),defineProperty(t,"baseURL",{enumerable:!0,value:"/"}),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var e={};return defineProperty(e,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(e,"mode",{enumerable:!0,writable:!0,value:"Mapview"}),e})()}),t}function parsePano(n,t){var e,r;return defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:String((e=n.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{enumerable:!0,writable:!0,value:(r=n.code)!==null&&r!==void 0?r:createUuid()}),defineProperty(t,"baseURL",{enumerable:!0,writable:!0,value:"/"}),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"index",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"panoIndex",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"panoId",{enumerable:!0,configurable:!1,writable:!1,value:panoStringify({workCode:t.workCode,panoIndex:0})}),defineProperty(o,"floorIndex",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(o,"derivedIdStr",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(o,"active",{enumerable:!0,configurable:!1,writable:!1,value:!0}),defineProperty(o,"loadable",{enumerable:!0,configurable:!1,writable:!1,value:!1}),defineProperty(o,"position",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,1.5,0)}),defineProperty(o,"standingPosition",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,0,0)}),defineProperty(o,"quaternion",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Quaternion(0,1,0,0)}),defineProperty(o,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().compose(o.position,o.quaternion,PANO_TEXTURE_SCALE)}),defineProperty(o,"accessibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"visibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"images",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var s={};defineProperty(s,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var u=0,l=FACE_ORDER$1;u<l.length;u++){var c=l[u];defineProperty(s,c,{enumerable:!0,configurable:!1,writable:!1,value:n[c]})}return defineProperty(s,"sizeList",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([n.size])}),defineProperty(s,"tiles",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var p=getImageSizeFromURL(s.front);if(p){var f=s.sizeList.slice();if(f[0]){var d=getTileLevel(f[0]);if(d)for(var h=d-1;h>=0;h--)f.unshift(512*Math.pow(2,h))}if(!(f.length<=0)){for(var m=[],A=0,g=f;A<g.length;A++){var y=g[A],v=getTileLevel(y);if(typeof v=="number"){var E={};if(defineProperty(E,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(E,"level",{enumerable:!0,configurable:!1,writable:!1,value:v}),y>p){defineProperty(E,"size",{enumerable:!0,configurable:!1,writable:!1,value:y}),defineProperty(E,"scale",{enumerable:!0,configurable:!1,writable:!1,value:1});for(var b=0,T=FACE_ORDER$1;b<T.length;b++){var _=T[b];defineProperty(E,_,{enumerable:!0,configurable:!1,writable:!1,value:replaceImageSize(s[_],y)})}}else{defineProperty(E,"size",{enumerable:!0,configurable:!1,writable:!1,value:p}),defineProperty(E,"scale",{enumerable:!0,configurable:!1,writable:!1,value:y/p});for(var S=0,R=FACE_ORDER$1;S<R.length;S++){var _=R[S];defineProperty(E,_,{enumerable:!0,configurable:!1,writable:!1,value:s[_]})}}m.push(E)}}return m=sortTile(m),Object.freeze(m)}}})()}),s})()}),defineProperty(o,"video",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),Object.freeze([o])})()}),defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"mode",{enumerable:!0,writable:!0,value:"Panorama"}),defineProperty(o,"panoIndex",{enumerable:!0,writable:!0,value:0}),o})()}),t}var workVerifySet=new WeakSet,Work=(function(){function n(t,e){this.observerBox=new THREE__namespace.Box3,this.observerBox=new THREE__namespace.Box3,this.transform=new THREE__namespace.Matrix4,this.shortPath=!1,this.jsonp=!1;var r;if(t!==null?typeof t=="object"&&typeof t.size=="number"&&typeof t.up=="string"&&typeof t.down=="string"&&typeof t.right=="string"&&typeof t.left=="string"&&typeof t.front=="string"&&typeof t.back=="string"?r=parsePano(t,this):r=parse(t,this):r=parseNull(t,this),r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1026
|
+
`,uniforms:{diffuse:{value:new THREE__namespace.Color},opacity:{value:1},displacementScalar:{value:0}}};function createPipeBufferGeometry(n,t,e,r){for(var o=new Float32Array((e+1)*(r+1)*3),s=new Float32Array((e+1)*(r+1)*3),u=new Float32Array((e+1)*(r+1)*2),l=new Uint32Array(e*r*6),c=n.computeFrenetFrames(e),p=new THREE__namespace.Vector3,f=new THREE__namespace.Vector3,d=new THREE__namespace.Vector2,h=new THREE__namespace.Vector3,m=0;m<=e;m++){h=n.getPointAt(m/e,h);for(var A=c.normals[m],g=c.binormals[m],y=0;y<=r;y++){var v=m*(r+1)+y,E=y/r*Math.PI*2,b=Math.sin(E),T=-Math.cos(E);f.x=T*A.x+b*g.x,f.y=T*A.y+b*g.y,f.z=T*A.z+b*g.z,f.normalize(),f.toArray(s,v*3),p.x=h.x+t*f.x,p.y=h.y+t*f.y,p.z=h.z+t*f.z,p.toArray(o,v*3),d.x=m/e,d.y=y/r,d.toArray(u,v*2)}}for(var m=0;m<e;m++)for(var y=0;y<r;y++){var _=(m*r+y)*6,S=(r+1)*m+y,R=(r+1)*(m+1)+y,w=(r+1)*(m+1)+(y+1),M=(r+1)*m+(y+1);l[_]=S,l[_+1]=R,l[_+2]=M,l[_+3]=R,l[_+4]=w,l[_+5]=M}var B=new THREE__namespace.BufferGeometry;return B.setIndex(new THREE__namespace.BufferAttribute(l,1)),B.setAttribute("position",new THREE__namespace.BufferAttribute(o,3)),B.setAttribute("normal",new THREE__namespace.BufferAttribute(s,3)),B.setAttribute("uv",new THREE__namespace.BufferAttribute(u,2)),B}function parseTrajectoryObject(n,t){for(var e=new THREE__namespace.Color(0).convertSRGBToLinear(),r=new THREE__namespace.Color(52949).convertSRGBToLinear(),o=new THREE__namespace.Color(3370495).convertSRGBToLinear(),s=new THREE__namespace.Color(16777215).convertSRGBToLinear(),u=0,l=new THREE__namespace.CurvePath,c=n.length,p=3;p<c;p+=3){var f=new THREE__namespace.Vector3().fromArray(n,p-3),d=new THREE__namespace.Vector3().fromArray(n,p);u+=f.distanceTo(d);var h=new THREE__namespace.LineCurve3(f,d);l.add(h)}var m=.03,A=Math.ceil(u*100),g=6,y=createPipeBufferGeometry(l,m,A,g);y.clearGroups(),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,1),y.addGroup(0,y.index?y.index.count:y.attributes.position.count,2);var v=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});v.uniforms.totalLength.value=u,v.uniforms.diffuse.value=e,v.uniforms.diffuse2.value=e,v.uniforms.opacity.value=.5,v.transparent=!0;var E=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.BackSide});E.uniforms.totalLength.value=u,E.uniforms.displacementScalar.value=-.01,E.uniforms.diffuse.value=r,E.uniforms.diffuse2.value=o;var b=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_PIPE_SHADER.vertexShader,fragmentShader:TRAJECTOR_PIPE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_PIPE_SHADER.uniforms),side:THREE__namespace.DoubleSide});b.uniforms.totalLength.value=u,b.uniforms.displacementScalar.value=-.026,b.uniforms.dashSize.value=new THREE__namespace.Vector2(.06,.09),b.uniforms.diffuse.value=s,b.uniforms.diffuse2.value=s;var T=new THREE__namespace.Mesh(y,[v,E,b]),_=.08,S=24,R=new THREE__namespace.SphereBufferGeometry(_,S,S);R.clearGroups(),R.addGroup(0,y.index?y.index.count:y.attributes.position.count,0),R.addGroup(0,y.index?y.index.count:y.attributes.position.count,1);var w=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.BackSide});w.uniforms.diffuse.value=e,w.uniforms.opacity.value=.5,w.transparent=!0;var M=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});M.uniforms.displacementScalar.value=-.01,M.uniforms.diffuse.value=r;var B=new THREE__namespace.Mesh(R,[w,M]);B.position.fromArray(n,0),T.add(B);var C=new THREE__namespace.ShaderMaterial({vertexShader:TRAJECTOR_SPHERE_SHADER.vertexShader,fragmentShader:TRAJECTOR_SPHERE_SHADER.fragmentShader,uniforms:THREE__namespace.UniformsUtils.clone(TRAJECTOR_SPHERE_SHADER.uniforms),side:THREE__namespace.FrontSide});C.uniforms.displacementScalar.value=-.01,C.uniforms.diffuse.value=o;var P=new THREE__namespace.Mesh(R,[w,C]);return P.position.fromArray(n,n.length-3),T.add(P),{scene:T,dispose:function(){y.dispose(),v.dispose(),E.dispose(),b.dispose(),R.dispose(),w.dispose(),M.dispose(),C.dispose()}}}function loadTrajectory(n,t){var e=n.name,r=appendSearch(n.content.uri,t.search),o=imageURL(r,{key:"model.0"});return n.content.loadState="LOADING",n.content.loadStateUpdateTime=now(),loadPly(o,{type:"geometry",customPropertyMapping:{time:{itemType:"uint32",itemNames:["time_milisec"]}},fetcher:t.fetcher}).then(function(s){var u,l,c,p,f=(l=(u=s.scene.attributes)===null||u===void 0?void 0:u.time.array)!==null&&l!==void 0?l:[],d=(p=(c=s.scene.attributes)===null||c===void 0?void 0:c.position.array)!==null&&p!==void 0?p:[],h=s.byteLength,m=s.memoryUsage,A=parseTrajectoryObject(d);A.scene.applyMatrix4(n.transform),A.scene.updateWorldMatrix(!1,!0),A.scene.matrixAutoUpdate=!1;var g=new TrajectoryNode(e,A.scene);return n.content.data={uri:o,byteLength:h,memoryUsage:m,positionArray:d,timeArray:f,object:g},n.content.byteLength=h,n.content.memoryUsage=m,n.content.loadState="READY",n.content.loadStateUpdateTime=now(),n}).catch(function(s){return n.content.data=void 0,n.content.loadState="FAILED",n.content.loadStateUpdateTime=now(),s instanceof NetworkResponseError&&s.httpStatus===0||s instanceof NetworkTimeoutError||s instanceof NetworkProxyError?n.content.loadfailRetryDelay=clamp$1(n.content.loadfailRetryDelay+RETRY_DELAY_STEP,RETRY_DELAY_STEP,MAX_RETRY_DELAY):n.content.loadfailRetryDelay=1/0,Promise.reject(s)})}function unloadTrajectory(n){n.content&&(n.content.data&&n.content.data.object.dispose(),n.content.data=void 0,n.content.loadState="UNLOADED",n.content.loadStateUpdateTime=now(),n.content.byteLength=0,n.content.memoryUsage=0)}var scratchVector3$7=new THREE__namespace.Vector3,scratchMatrix3=new THREE__namespace.Matrix3,scratchMatrix4$3=new THREE__namespace.Matrix4,a=6378137,invF=298.257223563;function ecefToLla(n){for(var t=a-a/invF,e=(a*a-t*t)/(a*a),r=Math.sqrt(n.x*n.x+n.y*n.y),o=1e-12,s=1e3,u=0,l=Math.atan2(n.z,r),c=0;u++<s;){var p=Math.sin(l),f=a/Math.sqrt(1-e*p*p);c=r/Math.cos(l)-f;var d=Math.atan2(n.z/(f*(1-e)+c),r/(f+c));if(isNaN(d))break;var h=Math.abs(d-l);if(h<o)break;l=d}return n.set(l,Math.atan2(n.y,n.x),c)}function llaToEcef(n){var t=n.x,e=n.y,r=n.z,o=a-a/invF,s=(a*a-o*o)/(a*a),u=Math.sin(t),l=Math.cos(t),c=Math.sin(e),p=Math.cos(e),f=a/Math.sqrt(1-s*u*u),d=(f+r)*l*p,h=(f+r)*l*c,m=(o*o/(a*a)*f+r)*u;return n.set(d,h,m)}function getEcefToEnuMatrix(n,t){var e=ecefToLla(scratchVector3$7.copy(n)),r=e.x,o=e.y,s=e.z,u=Math.sin(r),l=Math.sin(o),c=Math.cos(r),p=Math.cos(o);t.fromArray([-l,-u*p,c*p,0,+p,-u*l,c*l,0,0,c,u,0,0,0,0,1]);var f=scratchMatrix3.setFromMatrix4(t),d=scratchVector3$7.copy(n).applyMatrix3(f).multiplyScalar(-1);t.setPosition(d);var h=scratchMatrix4$3.fromArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,s,1]);return t.premultiply(h),t}var ROTATE_X_90_MATRIX=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ROTATE_X_90_MATRIX_INVERSE=new THREE__namespace.Matrix4().fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]),enuToLocalMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX),localToEnuMatrix=new THREE__namespace.Matrix4().copy(ROTATE_X_90_MATRIX_INVERSE);function getRecommendTile3dProps(n,t){var e,r,o;t===void 0&&(t={});var s,u,l,c=typeof n.tileset.rootMeta.creationTime=="string";if(c){var p=typeof n.tileset.rootMeta.numTotalPoints=="number"&&n.tileset.rootMeta.numTotalPoints>0;if(p){l=4,t.powerPreference==="high"&&(l=2),s=l/1.6;var f=0;if(((e=n.tileset.rootMeta.taskParameters)===null||e===void 0?void 0:e.point_homogenization)==="1"&&(!((r=n.tileset.rootMeta.taskParameters)===null||r===void 0)&&r.homo_point_density)){var d=Number((o=n.tileset.rootMeta.taskParameters)===null||o===void 0?void 0:o.homo_point_density);isFinite(d)&&!isNaN(d)&&(f=d)}f<=0&&(f=.02),u=f*1.4}else l=5,t.powerPreference==="high"&&(l=4),s=0,u=.03}else l=6,s=0,u=.03,n.name==="aerophoto"?(l=12,t.powerPreference==="high"&&(l=10)):n.tileset.asset.extras&&typeof n.tileset.asset.extras.name=="string"&&/^matterport\b/i.test(n.tileset.asset.extras.name)&&(l=5,t.powerPreference==="high"&&(l=4));return{pointScale:u,pointMinPixel:s,maxScreenSpaceError:l}}var scratchVector3$6=new THREE__namespace.Vector3,scratchSphereBoundingVolume=new SphereBoundingVolume,scratchBoxBoundingVolume=new BoxBoundingVolume,parameterVersionMap=new WeakMap,tileVersionMap=new WeakMap,trajectoryVersionMap=new WeakMap,STENCIL_CONSTANT={TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4},SKIP_BACKFACE_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.side=THREE__namespace.BackSide,n.color.setHex(16711935),n.colorWrite=!1,n.stencilWrite=!0,n.polygonOffset=!0,n.polygonOffsetFactor=2,n.polygonOffsetUnits=2,n.stencilRef=STENCIL_CONSTANT.TILE_MASK,n.stencilFunc=THREE__namespace.AlwaysStencilFunc,n.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,n.stencilZPass=THREE__namespace.ReplaceStencilOp,n.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK,n})(),SKIP_BACKFACE_TRANSPARENT_MATERIAL=(function(){var n=new THREE__namespace.MeshBasicMaterial;return n.visible=!1,n})(),CLEAR_STENCIL_GEOMETRY=new THREE__namespace.BufferGeometry,CLEAR_STENCIL_MATERIAL=new THREE__namespace.MeshBasicMaterial;function cloneSkipBackfaceObject(n){var t;n instanceof THREE__namespace.Mesh?t=new THREE__namespace.Mesh(n.geometry,Array.isArray(n.material)?n.material.map(function(s){return s.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL}):n.material&&n.material.transparent?SKIP_BACKFACE_TRANSPARENT_MATERIAL:SKIP_BACKFACE_MATERIAL):n instanceof THREE__namespace.Group?t=new THREE__namespace.Group:t=new THREE__namespace.Object3D,t.position.copy(n.position),t.quaternion.copy(n.quaternion),t.scale.copy(n.scale),t.matrix.compose(n.position,n.quaternion,n.scale),t.matrixAutoUpdate=!1,t.frustumCulled=n.frustumCulled,t.visible=n.visible;for(var e=0,r=n.children;e<r.length;e++){var o=r[e];t.add(cloneSkipBackfaceObject(o))}return t}var Tile3D=(function(n){__extends(t,n);function t(e,r){var o,s,u=n.call(this)||this;return u.parameter=new Parameter,u.renderObjects=[],u.backfaceObjects=[],u.tileObjects=[],u.frameNumber=0,u.error=(o=r.error)!==null&&o!==void 0?o:null,u.name=r.name,u.type=r.type,u.upAxis=r.upAxis,u.light=r.light,u.fetcher=r.fetcher,u.search=(s=r.search)!==null&&s!==void 0?s:"",u.groundHeight=r.groundHeight,u.coordinateSystem=r.coordinateSystem,u.boundingBox=new THREE__namespace.Box3,u.autoRefine=!0,u.refined=!1,u.refineProgress=[0,0],u.loaded=!1,u.disposed=!1,u.clearStencilObject=new THREE__namespace.Mesh(CLEAR_STENCIL_GEOMETRY,CLEAR_STENCIL_MATERIAL),u.clearStencilObject.frustumCulled=!1,u.clearStencilObject.onAfterRender=function(l){return l.clearStencil()},u.tileset=new Tileset(e,{tileLoader:function(l){return u.loadContent(l)},tileUnloader:function(l){return u.unloadContent(l)},onTileLoad:function(){},onTileUnload:function(l){},onTileError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Tile error",l.id,c)},trajectoryLoader:function(l){return u.loadTrajectory(l)},trajectoryUnloader:function(l){return u.unloadTrajectory(l)},onTrajectoryLoad:function(){},onTrajectoryUnload:function(l){},onTrajectoryError:function(l,c){u.onError&&u.onError(Object.assign(c,{error:c})),console.error("Trajectory error",l,c)}}),u.tileset.root.boundingVolume&&u.tileset.root.boundingVolume.getBoundingBox(u.boundingBox),u}return Object.defineProperty(t.prototype,"viewerRequestVolume",{get:function(){return this.tileset.root.viewerRequestVolume},set:function(e){this.tileset.root.viewerRequestVolume=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tiles",{get:function(){return this.tileset.selectedTiles},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trajectories",{get:function(){return this.tileset.trajectories},enumerable:!1,configurable:!0}),t.prototype.getRecommendProps=function(e){return e===void 0&&(e={}),getRecommendTile3dProps(this,e)},t.prototype.loadContent=function(e){var r=this;return loadTileContent(e,{light:this.light,fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){e.type==="SCENEGRAPH"&&(r.disposed||!e.content?unloadTileContent(e):e.content.data&&r.boundingBox.expandByObject(e.content.data.object))})},t.prototype.unloadContent=function(e){return unloadTileContent(e),Promise.resolve()},t.prototype.loadAllTilesets=function(){var e=this,r=function(o){var s=[];return e.tileset.root.traverse(function(u){var l;u.type==="TILESET"&&((l=u.content)===null||l===void 0?void 0:l.loadState)!=="READY"&&s.push(u)}),Promise.all(s.map(function(u){return e.loadContent(u).then(function(){return r()})})).then(function(){})};return r(this.tileset.root)},t.prototype.loadTrajectory=function(e){var r=this;return loadTrajectory(e,{fetcher:this.fetcher,search:this.search,renderer:this.renderer}).then(function(o){r.disposed&&unloadTrajectory(o)})},t.prototype.unloadTrajectory=function(e){return unloadTrajectory(e),Promise.resolve()},t.prototype.intersectRaycaster=function(e,r){var o=this,s,u,l=r!=null?r:[],c=[this.tileset.root],p=this.tileset.transform,f=(u=(s=e.params.Points)===null||s===void 0?void 0:s.threshold)!==null&&u!==void 0?u:0,d=e.hitFilter;e.hitFilter=function(T){var _;return Object.assign(T,{model:(_=o.parent)!==null&&_!==void 0?_:void 0,viewLayer:o}),d?d.call(e,T):!0};var h=e.sortByDistance;e.sortByDistance=!1;for(var m,A=1/0;m=c.pop();){var g=void 0;if(m.boundingVolume){var y=void 0;m.boundingVolume instanceof BoxBoundingVolume?y=scratchBoxBoundingVolume.copy(m.boundingVolume):m.boundingVolume instanceof SphereBoundingVolume?y=scratchSphereBoundingVolume.copy(m.boundingVolume):y=m.boundingVolume.clone(),y.applyMatrix4(p),g=y.intersectRay(e.ray,f,A)}else g=!0;if(g){for(var v=0,E=m.children.length;v<E;v++)c.push(m.children[v]);if(m.selected&&m.content&&m.content.data&&m.content.data.object.visible&&(m.content.data.object.intersectRaycaster(e,l),e.firstHitOnly)){var b=l[0];b&&A>b.distance&&(A=b.distance)}}}return e.hitFilter=d,e.sortByDistance=h,sortIntersects(l,e.sortByDistance,e.firstHitOnly),l},t.prototype.update=function(e,r,o,s){var u,l,c=this,p,f,d,h,m;this.renderer=e,this.frameNumber++;var A=!1,g=this.parameter.resolveValue(o.parameter,s.parameter);parameterVersionMap.get(this)!==g.version&&(parameterVersionMap.set(this,g.version),A=!0);var y=g.maxLevelOfDetail;y=Math.max(y,0);var v=Math.min(g.minLevelOfDetail,y);(!this.visible||!this.loaded||!o.loaded)&&(y=Math.max(v,0));var E=g.minGeometricError,b=r.controllerMode;(b==="Panorama"||b==="VRPanorama"||b==="XRPanorama")&&g.modelAlpha<.1&&(E=g.panoramaMinGeometricError);var T=g.maxGeometricError;T=Math.max(E,T);var _={time:r.time,camera:{type:r.type,position:new THREE__namespace.Vector3().copy(r.position),direction:r.getDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(r.up).applyQuaternion(r.quaternion),projectionMatrix:r.projectionMatrix.clone(),visible:r.visible,refine:r.refineModel},height:r.resolution.height,pixelRatio:r.pixelRatio,frameNumber:this.frameNumber,sseDenominator:2*Math.tan(.5*r.fov/180*Math.PI),cullingVolume:new CullingVolume().setFromCamera(r),minLevelOfDetail:v,maxLevelOfDetail:y,minGeometricError:E,maxGeometricError:T,skipLevelOfDetail:g.skipLevelOfDetail,mostDetail:g.mostDetail,loadSiblings:g.loadSiblings,cameraCulling:g.cameraCulling,maxMemoryUsage:g.maxMemoryUsage,maxRequests:g.maxRequests,requestOrder:g.requestOrder,maxScreenSpaceError:g.maxScreenSpaceError,memoryAdjustedOverflow:g.memoryAdjustedOverflow,memoryAdjustedScreenSpaceError:g.memoryAdjustedScreenSpaceError},S=g.cacheCameras.map(function(re){return re.updateProjectionMatrix(),__assign(__assign({},_),{camera:{type:r.type,position:new THREE__namespace.Vector3().copy(re.position),direction:re.getWorldDirection(new THREE__namespace.Vector3),up:new THREE__namespace.Vector3().copy(re.up),projectionMatrix:re.projectionMatrix.clone(),visible:re.visible,refine:!0},cullingVolume:new CullingVolume().setFromCamera(re)})});this.updateWorldMatrix(!0,!1),this.tileset.transform.equals(this.matrixWorld)||(this.tileset.transform.copy(this.matrixWorld),A=!0);var R=!this.autoRefine;if(R===!1){var w=g.progress>.01&&g.progress<.99;if(w){var M=new THREE__namespace.Vector3;g.pano0&&M.setFromMatrixPosition(g.pano0.matrix);var B=M.clone();g.pano1&&B.setFromMatrixPosition(g.pano1.matrix),M.distanceTo(B)<10&&(R=!0)}}if(R||this.tileset.update(_,S),this.refined=!0,this.refineProgress[0]=0,this.refineProgress[1]=0,this.tileset.needsRefinedTiles.forEach(function(re){if(c.refineProgress[1]++,re.content){var se=re.content.loadState;if(se==="UNLOADED"||se==="LOADING"){c.refined=!1;return}}c.refineProgress[0]++}),this.loaded===!1&&this.autoRefine){this.loaded=!0;var C=!1;this.tileset.needsRefinedTiles.forEach(function(re){if(c.loaded!==!1&&re.content){if(re.state.visible&&(C=!0),_.skipLevelOfDetail){if(re.state.finalResolution){var se=re.state.ancestorWithContentAvailable,he=se&&se.content?se.content:re.content,me=he.loadState;(me==="UNLOADED"||me==="LOADING")&&(c.loaded=!1)}}else if(re.state.visible&&re.levelOfContent<=0){var me=re.content.loadState;(me==="UNLOADED"||me==="LOADING")&&(c.loaded=!1)}}}),C&&this.tileset.selectedTiles.length===0&&this.tileset.frameNumber<500&&(this.loaded=!1),this.loaded===!0&&(this.refined=!1,this.refineProgress[1]++)}this.renderObjects.length=0,this.backfaceObjects.length=0,this.tileObjects.length=0,this.remove.apply(this,this.children),_.skipLevelOfDetail||this.tileset.selectedTiles.sort(function(re,se){return re.floor!==se.floor?re.floor-se.floor:re.levelOfContent!==se.levelOfContent?se.levelOfContent-re.levelOfContent:re.state.distanceToCamera!==se.state.distanceToCamera?re.state.distanceToCamera-se.state.distanceToCamera:re.state.centerZDepth-se.state.centerZDepth});for(var P=[],L=0,O=this.tileset.selectedTiles;L<O.length;L++){var F=O[L],N=(f=(p=F.content)===null||p===void 0?void 0:p.data)===null||f===void 0?void 0:f.object;if(N){var D=N.update(e,r,o,this,F,g);if(P.push(F.id),D&&(A=!0),this.tileset.hasMixedContent&&_.skipLevelOfDetail){if(!F.state.finalResolution){var U=cloneSkipBackfaceObject(N);U.name="skipBackface:"+N.name,this.backfaceObjects.push(U)}for(var z=F.state.selectionDepth,K=STENCIL_CONSTANT.TILE_MASK|z<<STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT,j=THREE__namespace.GreaterEqualStencilFunc,Q=STENCIL_CONSTANT.SKIP_LOD_MASK,V=THREE__namespace.ReplaceStencilOp,J=STENCIL_CONSTANT.TILE_MASK|STENCIL_CONSTANT.SKIP_LOD_MASK,W=0,X=N.materials;W<X.length;W++){var Z=X[W];Z.stencilWrite=!0,Z.stencilRef=K,Z.stencilFunc=j,Z.stencilFuncMask=Q,Z.stencilZPass=V,Z.stencilWriteMask=J}}else for(var Y=0,G=N.materials;Y<G.length;Y++){var Z=G[Y];Z.stencilWrite=!1,Z.stencilRef=STENCIL_CONSTANT.TILE_MASK,Z.stencilFunc=THREE__namespace.AlwaysStencilFunc,Z.stencilFuncMask=STENCIL_CONSTANT.TILE_MASK,Z.stencilZPass=THREE__namespace.ReplaceStencilOp,Z.stencilWriteMask=STENCIL_CONSTANT.TILE_MASK}this.tileObjects.push(N)}}var ee=P.toString();tileVersionMap.get(this)!==ee&&(tileVersionMap.set(this,ee),A=!0),_.skipLevelOfDetail&&this.backfaceObjects.length&&(u=this.renderObjects).push.apply(u,this.backfaceObjects),this.tileObjects.length&&(l=this.renderObjects).push.apply(l,this.tileObjects),_.skipLevelOfDetail&&this.renderObjects.push(this.clearStencilObject);for(var te=[],ne=0,ae=this.tileset.selectedTrajectories;ne<ae.length;ne++){var ce=ae[ne],ie=(d=ce.content.data)===null||d===void 0?void 0:d.object;if(ie){var D=ie.update(e,r,o,this,ce,g);te.push(ce.id),D&&(A=!0),this.renderObjects.push(ie)}}var fe=te.toString();trajectoryVersionMap.get(this)!==fe&&(trajectoryVersionMap.set(this,fe),A=!0);for(var ge=Math.min(0,((m=(h=this.parent)===null||h===void 0?void 0:h.children)!==null&&m!==void 0?m:[]).indexOf(this)),ye=ge*1e4,_e=function(re){var se=le.renderObjects[re],he=re+ye;se.traverse(function(me){(me instanceof THREE__namespace.Mesh||me instanceof THREE__namespace.Line||me instanceof THREE__namespace.Points)&&(me.renderOrder=he)}),le.add(se)},le=this,de=0;de<this.renderObjects.length;de++)_e(de);return A},t.prototype.dispose=function(){this.disposed=!0,this.tileset.reset(),this.tileset.root.children.length=0,/^blob\:/.test(this.tileset.id)&&URL.revokeObjectURL(this.tileset.id),this.remove.apply(this,this.children),this.refined=!1,this.loaded=!1,this.refineProgress[0]=this.refineProgress[1]=0,this.error=null,this.onError=void 0,this.renderer=void 0},Object.defineProperty(t.prototype,"model",{get:function(){return this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayer",{get:function(){return this},enumerable:!1,configurable:!0}),t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.enuToEcef=function(e){return e.applyMatrix4(this.coordinateSystem.enuToEcefMatrix)},t.prototype.ecefToEnu=function(e){return e.applyMatrix4(this.coordinateSystem.ecefToEnuMatrix)},t.prototype.localToEcef=function(e){return this.enuToEcef(this.localToEnu(e))},t.prototype.ecefToLocal=function(e){return this.enuToLocal(this.ecefToEnu(e))},t.prototype.localToLla=function(e){return ecefToLla(this.enuToEcef(this.localToEnu(e)))},t.prototype.llaToLocal=function(e){return this.enuToLocal(this.ecefToEnu(llaToEcef(e)))},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},t.prototype.worldToEcef=function(e){return this.localToEcef(this.worldToLocal(e))},t.prototype.ecefToWorld=function(e){return this.localToWorld(this.ecefToLocal(e))},t.prototype.worldToLla=function(e){return this.localToLla(this.worldToLocal(e))},t.prototype.llaToWorld=function(e){return this.localToWorld(this.llaToLocal(e))},Object.defineProperty(t.prototype,"coordinates",{get:function(){scratchVector3$6.setScalar(0);var e=this.localToLla(scratchVector3$6),r=e.x,o=e.y;return[r,o].map(function(s){return(s/Math.PI*180).toFixed(6)}).join(",")},enumerable:!1,configurable:!0}),t.prototype.getTransformMatrix4=function(e){return e===void 0&&(e=new THREE__namespace.Matrix4),e.copy(this.coordinateSystem.ecefToEnuMatrix),e.premultiply(enuToLocalMatrix),e.premultiply(this.matrixWorld),e},t.prototype.coordinatesToWorldPoint=function(e){var r=new THREE__namespace.Vector3(e.latitude,e.longitude,e.altitude);return this.llaToWorld(r)},t.prototype.worldPointToCoordinates=function(e){return scratchVector3$6.copy(e),this.worldToLla(scratchVector3$6),{latitude:scratchVector3$6.x,longitude:scratchVector3$6.y,altitude:scratchVector3$6.z}},t.prototype.resetBrightness=function(){this.parameter.reset("brightness")},Object.defineProperty(t.prototype,"minLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minLevelOfDetail},set:function(e){this.parameter.set("minLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxLevelOfDetail},set:function(e){this.parameter.set("maxLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).minGeometricError},set:function(e){this.parameter.set("minGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxGeometricError},set:function(e){this.parameter.set("maxGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoramaMinGeometricError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).panoramaMinGeometricError},set:function(e){this.parameter.set("panoramaMinGeometricError",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"skipLevelOfDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).skipLevelOfDetail},set:function(e){this.parameter.set("skipLevelOfDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mostDetail",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).mostDetail},set:function(e){this.parameter.set("mostDetail",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadSiblings",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).loadSiblings},set:function(e){this.parameter.set("loadSiblings",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxMemoryUsage",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxMemoryUsage},set:function(e){this.parameter.set("maxMemoryUsage",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxRequests",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxRequests},set:function(e){this.parameter.set("maxRequests",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"requestOrder",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).requestOrder},set:function(e){this.parameter.set("requestOrder",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxScreenSpaceError",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&(r.unshift(this.parent.parameter),this.parent.parent&&this.parent.parent.parameter instanceof Parameter&&r.unshift(this.parent.parent.parameter)),(e=this.parameter).resolveValue.apply(e,r).maxScreenSpaceError},set:function(e){this.parameter.set("maxScreenSpaceError",e)},enumerable:!1,configurable:!0}),t})(THREE__namespace.Object3D),fetcherMap=new WeakMap;function getFetcher(n){var t=fetcherMap.get(n);if(t)return t;throw new Error("fetcher never registered.")}function registerFetcher(n,t){return fetcherMap.set(n,t)}var scratchVector3$5=new THREE__namespace.Vector3,scratchMatrix4$2=new THREE__namespace.Matrix4;function getEcefToEnuMatrixFromUpAxis(n,t,e){switch(n){case"Z":e.identity();break;case"Y":e.fromArray([1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1]);break;case"-Y":e.fromArray([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]);break;case"WGS84":case"GCJ02":case"BD09":getEcefToEnuMatrix(t,e);break;default:e.identity();break}return e}function getExt(n){var t=/([0-9a-z\.\_\-]+)([\?\#].*)?$/i.exec(n);if(t){var e=String(t[1]).trim().split(".").slice(1).reverse()[0];if(e)return e}return""}function loadViewLayer(n,t){var e,r=n.tileset,o=n.name,s=n.type,u=n.work.getURL(r),l=u.split("#"),c=l[0],p=l[1],f=(e=(p||c).split("?")[1])!==null&&e!==void 0?e:"";return t.fetcher.ajax(u,{responseType:"text"}).catch(function(d){return{error:d,body:JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{geometricError:0}})}}).then(function(d){var h,m="error"in d?d.error:null,A=normalizeTilesetHeader(JSON.parse(d.body),u),g=A.root,y=A.rootMeta,v=y===void 0?{}:y,E=n.upAxis;v.upAxis&&v.upAxis!==E&&(E=v.upAxis),"lodVersion"in A&&(E="-Y","floorInfo"in A&&(A.properties=A.properties||{},A.properties.floorInfo=A.floorInfo.map(function(w){return{ground:-w.ground,height:w.height}}),A.floorInfo=void 0),A.asset.tilesetVersion=String(A.lodVersion),A.lodVersion=void 0);var b=g.boundingVolume?makeBoundingVolume(g.boundingVolume):void 0;b&&g.transform&&b.applyMatrix4(scratchMatrix4$2.fromArray(g.transform));var T=null,_=new THREE__namespace.Matrix4,S=new THREE__namespace.Matrix4;v.coordinate?(T=v.coordinate.ground_height,_.fromArray(v.coordinate.pose_ecef_to_enu),S.fromArray(v.coordinate.pose_enu_to_ecef)):(b?b.getCenter(scratchVector3$5):scratchVector3$5.setScalar(0),getEcefToEnuMatrixFromUpAxis(E,scratchVector3$5,_),S.getInverse(_)),A.root={refine:(h=g.refine)!==null&&h!==void 0?h:"REPLACE",geometricError:g.geometricError,transform:scratchMatrix4$2.copy(_).premultiply(enuToLocalMatrix).toArray(),boundingVolume:b?b.toJson():void 0,children:[g]};var R=new Tile3D(A,{name:o,type:s,upAxis:E,light:t.light,fetcher:t.fetcher,search:f,groundHeight:T,coordinateSystem:{enuToEcefMatrix:S,ecefToEnuMatrix:_},error:m});return R})}function loadViewLayers(n,t){var e,r,o=n.layers.slice();if(n.file){for(var s=!1,u=0,l=o;u<l.length;u++){var c=l[u];if(c.type==="mesh"){s=!0;break}}if(s===!1){var p=getExt(n.file)||"at3d",f=JSON.stringify({asset:{version:"0.0"},geometricError:0,root:{refine:"REPLACE",geometricError:0,transform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],content:{uri:n.work.getURL(n.file)},extras:(e={},e[p]={textureBaseUri:typeof n.textureBase=="string"?n.work.getURL(n.textureBase):void 0,textureArray:n.textures,textureOptions:(r=t.textureOptions)!==null&&r!==void 0?r:{}},e)}});o.push({work:n.work,name:"fallback",type:"mesh",upAxis:"Z",tileset:URL.createObjectURL(new Blob([f],{type:"application/json"}))})}}return o.map(function(d){return loadViewLayer(d,{fetcher:t.fetcher,light:t.light}).then(function(h){return t.onError&&(h.error&&t.onError(h.error),h.onError=t.onError),h})})}function createSimpleBoxBufferGeometry(n,t,e){n===void 0&&(n=1),t===void 0&&(t=1),e===void 0&&(e=1);var r=n/2,o=t/2,s=e/2,u=new Float32Array([-r,+o,+s,+r,+o,+s,+r,+o,-s,-r,+o,-s,-r,-o,+s,+r,-o,+s,+r,-o,-s,-r,-o,-s]),l=new Uint32Array([0,4,1,1,4,5,1,5,2,2,5,6,2,6,3,3,6,7,3,7,0,0,7,4,3,0,2,2,0,1,4,7,5,5,7,6]),c=new THREE__namespace.BufferGeometry;return c.setAttribute("position",new THREE__namespace.BufferAttribute(u,3)),c.setIndex(new THREE__namespace.BufferAttribute(l,1)),c.addGroup(0,c.index.count,0),c.computeBoundingBox(),c.computeBoundingSphere(),c}function mergeBufferGeometries(n,t){for(var e=n[0].index!==null,r=new Set(Object.keys(n[0].attributes)),o=new Set(Object.keys(n[0].morphAttributes)),s={},u={},l=new THREE__namespace.BufferGeometry,c=0;c<n.length;++c){var p=n[c];if(e!==(p.index!==null))return null;for(var f in p.attributes){if(!r.has(f))return null;s[f]===void 0&&(s[f]=[]),s[f].push(p.attributes[f])}for(var f in p.morphAttributes){if(!o.has(f))return null;u[f]===void 0&&(u[f]=[]),u[f].push(p.morphAttributes[f])}l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(p.userData)}if(e){for(var d=0,h=[],c=0;c<n.length;++c){for(var m=n[c].index,A=0;A<m.count;++A)h.push(m.getX(A)+d);d+=n[c].attributes.position.count}l.setIndex(h)}for(var f in s){var g=mergeBufferAttributes(s[f]);if(!g)return null;l.setAttribute(f,g)}for(var f in u){var y=u[f][0].length;if(y===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[f]=[];for(var c=0;c<y;++c){for(var v=[],A=0;A<u[f].length;++A)v.push(u[f][A][c]);var E=mergeBufferAttributes(v);if(!E)return null;l.morphAttributes[f].push(E)}}return l}function mergeBufferAttributes(n){for(var t,e,r,o=0,s=0;s<n.length;++s){var u=n[s];if(u.isInterleavedBufferAttribute||(t===void 0&&(t=u.array.constructor),t!==u.array.constructor)||(e===void 0&&(e=u.itemSize),e!==u.itemSize)||(r===void 0&&(r=u.normalized),r!==u.normalized))return null;o+=u.array.length}for(var l=new t(o),c=0,s=0;s<n.length;++s)l.set(n[s].array,c),c+=n[s].array.length;return new THREE__namespace.BufferAttribute(l,e,r)}function mergeVertices(n,t){t===void 0&&(t=1e-4),t=Math.max(t,Number.EPSILON);for(var e={},r=n.getIndex(),o=n.getAttribute("position"),s=r?r.count:o.count,u=0,l=Object.keys(n.attributes),c={},p={},f=[],d=["getX","getY","getZ","getW"],h=0,m=l.length;h<m;h++){var A=l[h];c[A]=[];var g=n.morphAttributes[A];g&&(p[A]=new Array(g.length).fill().map(function(){return[]}))}for(var y=Math.log10(1/t),v=Math.pow(10,y),h=0;h<s;h++){for(var E=r?r.getX(h):h,b="",T=0,m=l.length;T<m;T++)for(var A=l[T],_=n.getAttribute(A),S=_.itemSize,R=0;R<S;R++)b+="".concat(~~(_[d[R]](E)*v),",");if(b in e)f.push(e[b]);else{for(var T=0,m=l.length;T<m;T++)for(var A=l[T],_=n.getAttribute(A),g=n.morphAttributes[A],S=_.itemSize,w=c[A],M=p[A],R=0;R<S;R++){var B=d[R];if(w.push(_[B](E)),g)for(var C=0,P=g.length;C<P;C++)M[C].push(g[C][B](E))}e[b]=u,f.push(u),u++}}for(var L=n.clone(),h=0,m=l.length;h<m;h++){var A=l[h],O=n.getAttribute(A),F=new O.array.constructor(c[A]),_=new THREE__namespace.BufferAttribute(F,O.itemSize,O.normalized);if(L.setAttribute(A,_),A in p)for(var T=0;T<p[A].length;T++){var N=n.morphAttributes[A][T],F=new N.array.constructor(p[A][T]),D=new THREE__namespace.BufferAttribute(F,N.itemSize,N.normalized);L.morphAttributes[A][T]=D}}return L.setIndex(f),L}var scratchSphere$1=new THREE__namespace.Sphere,scratchMatrix4$1=new THREE__namespace.Matrix4,scratchMatrix4Inverse=new THREE__namespace.Matrix4;function getEdgesBySphere(n,t,e){e===void 0&&(e=30/180*Math.PI);for(var r=Math.cos(e),o=[],s=0,u=n.children;s<u.length;s++){var l=u[s];l instanceof Tile3D&&l.tileset.selectedTiles.forEach(function(c){var p,f,d,h=(f=(p=c.content)===null||p===void 0?void 0:p.data)===null||f===void 0?void 0:f.object;if(h&&h.visible){var m=[];if(h.traverseVisible(function(j){if(j instanceof THREE__namespace.Mesh){var Q=getBvhTreeForMesh(j);if(Q){scratchMatrix4$1.copy(j.matrixWorld),scratchMatrix4Inverse.getInverse(scratchMatrix4$1),scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);var V=Q.trianglesInSphere(scratchSphere$1.center,scratchSphere$1.radius),J=new THREE__namespace.BufferGeometry;J.setAttribute("position",new THREE__namespace.BufferAttribute(V,3)),J.applyMatrix4(j.matrixWorld),J=mergeVertices(J,.01),m.push(J)}}}),m.length===0)return;for(var A=["a","b","c"],g=mergeBufferGeometries(m),y=g.getAttribute("position").array,v=((d=g.getIndex())===null||d===void 0?void 0:d.array)||[],E=[],b=[],T=0,_=y.length;T<_;T+=3){var S=new THREE__namespace.Vector3(y[T],y[T+1],y[T+2]);E.push(S)}for(var T=0,_=v.length;T<_;T+=3){var R=v[T],w=v[T+1],M=v[T+2],B=new THREE__namespace.Vector3().crossVectors(E[w].clone().sub(E[R]),E[M].clone().sub(E[R])).normalize();b.push({a:R,b:w,c:M,normal:B})}for(var C={},T=0,_=b.length;T<_;T++)for(var P=b[T],L=0;L<3;L++){var O=P[A[L]],F=P[A[(L+1)%3]],N=[Math.min(O,F),Math.max(O,F)],D=N[0]+"-"+N[1];C[D]===void 0?C[D]={index1:N[0],index2:N[1],face1:T}:C[D].face2=T}for(var D in C){var U=C[D];if(U.face2===void 0||b[U.face1].normal.dot(b[U.face2].normal)<=r){var z=E[U.index1],K=E[U.index2];o.push(new THREE__namespace.Line3(z,K))}}E.length=0,b.length=0}})}return o}var scratchBoundingBox$1=new THREE__namespace.Box3,scratchViewLayerBox=new THREE__namespace.Box3,scratchObserverBox$3=new THREE__namespace.Box3,Model=(function(n){__extends(t,n);function t(e,r){r===void 0&&(r={});var o,s=n.call(this)||this;s.disposed=!1,s.parameter=new Parameter,s.outdated=!1,s.autoRefine=!0,s.metaPending=!1,s.loaded=!1,s.refined=!1,s.refineProgress=[0,0],s.boundingBox=new THREE__namespace.Box3,s.needsRender=!1,s.work=e,s.name=s.work.workCode;for(var u=0,l=0,c=e.observers;l<c.length;l++){var p=c[l];u=Math.max(u,p.floorIndex)}if(s.floorLength=u+1,e.model){s.metaPending=!0;var f=loadViewLayers(e.model,{fetcher:getFetcher(e),light:(o=r.light)!==null&&o!==void 0?o:!1,textureOptions:r.textureOptions,onError:function(d){return s.dispatchEvent({type:"error",error:d})}});s.initReady=Promise.all(f).then(function(d){if(s.metaPending=!1,d.length)if(s.disposed)for(var h=0,m=d;h<m.length;h++){var A=m[h];A.dispose()}else s.add.apply(s,d)}),s.loadedReady=new Promise(function(d){var h=function(){d(),s.removeEventListener("load",h),s.removeEventListener("dispose",h)};s.addEventListener("load",h),s.addEventListener("dispose",h)})}else s.refined=!0,s.loaded=!0,s.initReady=Promise.resolve(),s.loadedReady=Promise.resolve();return s.parameter.set("boundingBox",s.boundingBox.clone()),s}return t.prototype.dispose=function(){this.disposed=!0;for(var e;e=this.children[0];)typeof e.dispose=="function"&&e.dispose(),this.remove(e);this.dispatchEvent({type:"dispose"})},Object.defineProperty(t.prototype,"empty",{get:function(){return this.children.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewLayers",{get:function(){return this.children},enumerable:!1,configurable:!0}),t.prototype.getEdgesBySphere=function(e,r){return r===void 0&&(r=30/180*Math.PI),getEdgesBySphere(this,e,r)},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=e.sortByDistance;e.sortByDistance=!1;for(var u=0,l=this.children.length;u<l;u++){var c=this.children[u];c.visible&&typeof c.intersectRaycaster=="function"&&c.intersectRaycaster(e,o)}return e.sortByDistance=s,sortIntersects(o,e.sortByDistance,e.firstHitOnly),o},t.prototype.update=function(e,r,o){var s=!1;this.needsRender===!0&&(this.needsRender=!1,s=!0);var u=this.loaded;this.refined=!this.metaPending,this.loaded=!this.metaPending,this.refineProgress[0]=this.refineProgress[1]=0,this.work.transform.equals(this.matrix)||(this.matrix.copy(this.work.transform),this.matrix.decompose(this.position,this.quaternion,this.scale),this.matrixAutoUpdate=!1,s=!0);for(var l=0,c=this.children;l<c.length;l++){var p=c[l];p.autoRefine=this.autoRefine;var f=p.update(e,r,o,this);f&&(s=!0),p.refined===!1&&(this.refined=!1),p.loaded===!1&&(this.loaded=!1),this.refineProgress[0]+=p.refineProgress[0],this.refineProgress[1]+=p.refineProgress[1]}scratchBoundingBox$1.makeEmpty(),scratchObserverBox$3.copy(this.work.observerBox),scratchObserverBox$3.isEmpty()||(scratchObserverBox$3.max.x+=1,scratchObserverBox$3.max.z+=1,scratchObserverBox$3.max.y+=1,scratchObserverBox$3.min.x-=1,scratchObserverBox$3.min.z-=1,scratchBoundingBox$1.union(scratchObserverBox$3));for(var d=0,h=this.viewLayers;d<h.length;d++){var p=h[d];p.boundingBox.isEmpty()||(scratchViewLayerBox.copy(p.boundingBox),scratchBoundingBox$1.union(scratchViewLayerBox))}return scratchBoundingBox$1.applyMatrix4(this.matrix),scratchBoundingBox$1.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox$1),this.parameter.set("boundingBox",scratchBoundingBox$1.clone())),u===!1&&this.loaded===!0&&this.dispatchEvent({type:"load"}),s},t.prototype.localToEnu=function(e){return e.applyMatrix4(localToEnuMatrix)},t.prototype.enuToLocal=function(e){return e.applyMatrix4(enuToLocalMatrix)},t.prototype.worldToEnu=function(e){return this.localToEnu(this.worldToLocal(e))},t.prototype.enuToWorld=function(e){return this.localToWorld(this.enuToLocal(e))},Object.defineProperty(t.prototype,"shownFloor",{get:function(){return this.shownFloorIndex===-1?null:this.shownFloorIndex},set:function(e){this.shownFloorIndex=e===null?-1:e},enumerable:!1,configurable:!0}),t.prototype.show=function(e){this.shownFloor=e!=null?e:null,this.dispatchEvent({type:"changeShownFloor",shownFloor:e})},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r)},Object.defineProperty(t.prototype,"shownFloorIndex",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).shownFloorIndex},set:function(e){this.parameter.set("shownFloorIndex",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).brightness},set:function(e){this.parameter.set("brightness",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clippers",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).clippers},set:function(e){this.parameter.set("clippers",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"customShaders",{get:function(){var e,r=[];return this.parent&&this.parent.parameter instanceof Parameter&&r.unshift(this.parent.parameter),(e=this.parameter).resolveValue.apply(e,r).customShaders},set:function(e){this.parameter.set("customShaders",e)},enumerable:!1,configurable:!0}),t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.viewLayers;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Object3D),scratchBoundingBox3=new THREE__namespace.Box3,scratchModelBoundingBox3=new THREE__namespace.Box3,ModelScene=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;e.needsRender=!0,e.autoRefine=!0,e.boundingBox=new THREE__namespace.Box3,e.loaded=!1,e.refined=!1,e.refineProgress=[0,0],e.parameter=new Parameter;var r=e.models=[];e.parameter.set("boundingBox",e.boundingBox.clone());var o=e;return defineProperty(r,"autoUpdate",{get:function(){return o.autoRefine},set:function(s){o.autoRefine=s}}),defineProperty(r,"bounding",{get:function(){return o.boundingBox}}),defineProperty(r,"loaded",{get:function(){return o.loaded}}),defineProperty(r,"refined",{get:function(){return o.refined}}),defineProperty(r,"refineProgress",{get:function(){return o.refineProgress}}),defineProperty(r,"cacheCameras",{get:function(){return o.parameter.resolveValue().cacheCameras},set:function(s){o.parameter.set("cacheCameras",s)}}),defineProperty(r,"intersectRaycaster",{value:function(s){return o.intersectRaycaster(s)}}),defineProperty(r,"setMaterial",{value:function(s){return o.setMaterial(s)}}),defineProperty(r,"getMaterial",{value:function(){return o.getMaterial()}}),defineProperty(r,"resetBrightness",{value:function(){return o.resetBrightness()}}),e}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.add.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}return this.needsRender=!0,this},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];n.prototype.remove.apply(this,e),this.models.length=0;for(var o=0,s=this.children;o<s.length;o++){var u=s[o];u instanceof Model&&u.outdated!==!0&&this.models.push(u)}scratchBoundingBox3.makeEmpty();for(var l=0,c=this.children;l<c.length;l++){var u=c[l];u instanceof Model&&(scratchModelBoundingBox3.copy(u.boundingBox).applyMatrix4(u.matrix),scratchBoundingBox3.union(scratchModelBoundingBox3))}return this.boundingBox.copy(scratchBoundingBox3),this.needsRender=!0,this},t.prototype.intersectRaycaster=function(e,r){var o=r!=null?r:[],s=this.children.filter(function(f){return f instanceof Model});if(s.length===1)s[0].intersectRaycaster(e,o);else{var u=e.sortByDistance;e.sortByDistance=!1;for(var l=0,c=s;l<c.length;l++){var p=c[l];p.visible&&p.intersectRaycaster(e,o)}e.sortByDistance=u,sortIntersects(o,e.sortByDistance,e.firstHitOnly)}return o},t.prototype.update=function(e,r){var o=!1;scratchBoundingBox3.makeEmpty(),this.loaded=this.models.length>0,this.refined=this.models.length>0,this.refineProgress[0]=this.refineProgress[1]=0,this.models.length=0;for(var s=0,u=this.children;s<u.length;s++){var l=u[s];if(l instanceof Model)if(l.outdated){l.autoRefine=!1;var c=l.update(e,r,this);c&&(o=!0)}else{this.models.push(l),l.autoRefine=this.autoRefine;var c=l.update(e,r,this);c&&(o=!0),l.loaded===!1&&(this.loaded=!1),l.refined===!1&&(this.refined=!1),this.refineProgress[0]+=l.refineProgress[0],this.refineProgress[1]+=l.refineProgress[1],scratchModelBoundingBox3.copy(l.boundingBox),scratchBoundingBox3.union(scratchModelBoundingBox3)}else if(l.update){var c=l.update(e,r,this);c&&(o=!0)}}return scratchBoundingBox3.equals(this.boundingBox)||(this.boundingBox.copy(scratchBoundingBox3),this.parameter.set("boundingBox",scratchBoundingBox3.clone())),this.needsRender=o,o},Object.defineProperty(t.prototype,"bounding",{get:function(){return this.boundingBox},enumerable:!1,configurable:!0}),t.prototype.setMaterial=function(e){this.parameter.set(e)},t.prototype.getMaterial=function(){return this.parameter.resolveValue()},t.prototype.resetBrightness=function(){this.parameter.reset("brightness");for(var e=0,r=this.models;e<r.length;e++){var o=r[e];o.resetBrightness()}},t})(THREE__namespace.Scene);function workInitialToJson(n){var t={};return typeof n.mode!="undefined"&&(t.mode=n.mode),typeof n.panoIndex!="undefined"&&(t.pano_index=n.panoIndex),typeof n.longitude!="undefined"&&(t.longitude=n.longitude),typeof n.latitude!="undefined"&&(t.latitude=n.latitude),typeof n.fov!="undefined"&&(t.fov=n.fov),typeof n.distance!="undefined"&&(t.distance=n.distance),typeof n.offset!="undefined"&&(t.offset=n.offset.toArray()),t}function workModelToJson(n){var t;if(n)return{file_url:n.file,material_base_url:n.textureBase,material_textures:(t=n.textures)===null||t===void 0?void 0:t.slice(),layers:n.layers.map(function(e){return{tileset_url:e.tileset,up_axis:e.upAxis,name:e.name,type:e.type}})}}function workObserverToObserverJson(n){return{index:n.index,floor_index:n.floorIndex,position:n.position.toArray(),standing_position:n.standingPosition.toArray(),quaternion:{x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w},visible_nodes:n.visibleNodes.slice(),accessible_nodes:n.accessibleNodes.slice()}}function workObserverToPanoramaJson(n){return{index:n.index,active:n.active,loadable:n.loadable,derived_id:n.derivedId,derived_id_str:n.derivedIdStr,size_list:n.images.sizeList.slice(),up:n.images.up,down:n.images.down,right:n.images.right,left:n.images.left,front:n.images.front,back:n.images.back,video:n.video?{matrix:n.video.matrix.toArray(),size:n.video.size.toArray(),source:n.video.source}:void 0}}function workToJson(n){return{allow_hosts:n.allowHosts.slice(),expire_at:n.expire.getTime().toString(),project_id:n.projectId,code:n.workCode,name:n.name,base_url:n.baseURL,initial:workInitialToJson(n.initial),model:workModelToJson(n.model),observers:n.observers.map(function(t){return workObserverToObserverJson(t)}),panorama:{count:n.observers.length,list:n.observers.map(function(t){return workObserverToPanoramaJson(t)})}}}function isNumber(n){return typeof n=="number"}function jsonClone(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(function(o){return typeof o!="object"||o===null?o:jsonClone(o)});var t={};for(var e in n){var r=n[e];t[e]=typeof r!="object"||r===null?r:jsonClone(r)}return t}function getType(n){return n==null?"null":Array.isArray(n)?"array":typeof n=="object"?"dict":"value"}function jsonMerge(n,t){var e=getType(n),r=getType(t);if(r==="null")return n;if(r==="value")return t;if(r!==e)return jsonClone(t);if(r==="array")for(var o=0;o<t.length;o++)n[o]=jsonMerge(n[o],t[o]);else if(r==="dict")for(var s in t)n[s]=jsonMerge(n[s],t[s]);return n}function jsonStableStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],p=jsonStableStrinfiy_(n[c],!0);p!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+p),s++}return"{"+r+"}"}switch(e){case"function":return JSON.stringify(n.toString());case"undefined":return t?void 0:null;case"number":return n;default:return isFinite(n)?n:null}}function jsonStableStrinfiy(n){return jsonStableStrinfiy_(n,!1)}function jsonHash(n){return"hash::".concat(sha256(jsonStableStrinfiy(n)))}var PANO_ID_REG=/^(.*)\[(\d+)\]$/;function panoStringify(n){if(!isNaN(n.panoIndex)&&isFinite(n.panoIndex))return"".concat(n.workCode,"[").concat(n.panoIndex,"]");throw new Error("Invalid Pano")}function panoParse(n){var t=n.match(PANO_ID_REG);if(t){t[0];var e=t[1],r=t[2],o=Math.floor(Number(r));if(!isNaN(o)&&isFinite(o))return{workCode:e,panoIndex:o}}throw new Error("Invalid PanoId")}function panoEqual(n,t){return panoStringify(n)===panoStringify(t)}function isPanoId(n){return typeof n=="string"&&PANO_ID_REG.test(n)}function deepFreeze(n){Object.freeze(n);var t=typeof n=="function",e=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(n).forEach(function(r){e.call(n,r)&&(!t||r!=="caller"&&r!=="callee"&&r!=="arguments")&&n[r]!==null&&(typeof n[r]=="object"||typeof n[r]=="function")&&!Object.isFrozen(n[r])&&deepFreeze(n[r])}),n}var URL_REGEXP=/^[0-9a-z]+\:\/\/(([^:/?#]*)(?::[0-9]+)?)/i,BUILDIN_ALLOW_HOST=deepFreeze(JSON.parse((function n(){var t=113,e=126,r=0,o="";return arguments[r].split(o).map(function(s){return s.charCodeAt(r)>e?s:String.fromCharCode((s.charCodeAt(r)+t)%e)}).join(o)})("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/rnyrr;p{/9/rnyrr;p|z/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"))),domainRegex=/^([^.]+)(\.([^.]+))*$/,currentHostname=typeof location!="undefined"?location.hostname:"localhost";function isIPDomain(n){return/^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(n)}function matchDomain(n,t){if(!domainRegex.test(n)||!domainRegex.test(t))return!1;if(n==="*")return!0;var e=n.split(".").reverse(),r=t.split(".").reverse();if(e.length<=1)return n===t;for(var o=0;o<e.length;o++)if(e[o]!==r[o])return!1;return!0}function hostnameFromURL(n){if(/^blob\:/i.test(n)||/^data\:/i.test(n))return currentHostname;var t=n.match(URL_REGEXP);return t?t[2]:currentHostname}var error_invalid_input=function(){return new Error("Invalid input.")},error_invalid_certificate=function(){return new Error("Invalid certificate.")},error_invalid_signature=function(){return new Error("Invalid signature.")},error_date_expired=function(n){return new Error("Date(".concat(n.toString(),") expired."))},error_host_not_allowed=function(n){return new Error("Host(".concat(JSON.stringify(n),") is not allowed."))};function ObjectOmit(n,t){for(var e={},r=0,o=Object.keys(n);r<o.length;r++){var s=o[r];t.indexOf(s)===-1&&(e[s]=n[s])}return e}function jsonStableNoneNumberStrinfiy_(n,t){t===void 0&&(t=!1);var e=typeof n;if(e==="string")return JSON.stringify(n);if(n===!0)return"true";if(n===!1)return"false";if(n===null)return"null";if(n instanceof Array){for(var r="[",o=n.length-1,s=0;s<o;s++)r+=jsonStableNoneNumberStrinfiy_(n[s],!1)+",";return o>-1&&(r+=jsonStableNoneNumberStrinfiy_(n[s],!1)),r+"]"}if(n instanceof Object){if(typeof n.toJSON=="function")return jsonStableNoneNumberStrinfiy_(n.toJSON(),t);for(var u=Object.keys(n).sort(),l=u.length,r="",s=0;s<l;){var c=u[s],p=jsonStableNoneNumberStrinfiy_(n[c],!0);p!==void 0&&(s&&r!==""&&(r+=","),r+=JSON.stringify(c)+":"+p),s++}return"{"+r+"}"}switch(e){case"function":case"undefined":return t?void 0:null;case"number":return 0;default:return isFinite(n)?n:null}}function jsonStableNoneNumberStrinfiy(n){return String(jsonStableNoneNumberStrinfiy_(n,!1))}function verify(n){var t,e,r,o={};try{o=typeof n=="string"?JSON.parse(n):n}catch(y){return error_invalid_input()}if(typeof o!="object")return error_invalid_input();var s=currentHostname,u=Date.now(),l=new Date(typeof o.expire_at=="string"&&/^\d+$/.test(o.expire_at)?Number(o.expire_at):o.expire_at),c=Array.isArray(o.allow_hosts)?o.allow_hosts:[];if(s.length===0||isIPDomain(s)||BUILDIN_ALLOW_HOST.filter(function(y){return matchDomain(y,s)}).length>0){var p=String((t=o.certificate)!==null&&t!==void 0?t:"");if(p)try{var f=new X509;return f.readCertPEM(p),deepFreeze({issuer:f.getSubjectString(),expire:l,allowHosts:c})}catch(y){var d=y instanceof Error?y.message:String(y);console.warn("[PARSE Error]: Invalid Certificate. "+d)}return deepFreeze({issuer:"none",expire:l,allowHosts:c})}var h=String((e=o.certificate)!==null&&e!==void 0?e:"");if(!h)return error_invalid_certificate();var m=new X509;m.readCertPEM(h);var A=String((r=o._signature)!==null&&r!==void 0?r:"");if(!A)return error_invalid_signature();var g=jsonStableNoneNumberStrinfiy(ObjectOmit(o,["_signature"]));return verifyMessage(g,A,m)===!1?error_invalid_signature():u<l.getTime()?BUILDIN_ALLOW_HOST.concat(c).filter(function(y){return matchDomain(y,s)}).length===0?error_host_not_allowed(s):deepFreeze({issuer:m.getSubjectString(),expire:l,allowHosts:c}):error_date_expired(l)}function verifyURL(n,t){var e=hostnameFromURL(n);return currentHostname.length!==0&&!isIPDomain(currentHostname)&&BUILDIN_ALLOW_HOST.filter(function(r){return matchDomain(r,currentHostname)}).length===0&&!isIPDomain(e)&&BUILDIN_ALLOW_HOST.concat(t).filter(function(r){return matchDomain(r,e)}).length===0?error_host_not_allowed(e):n}var PANO_TEXTURE_SCALE=new THREE__namespace.Vector3(1,1,1),FACE_ORDER$1=["right","left","up","down","front","back"];function relativeURL(n,t){if(!isAbsoluteURL(n))return n;if(n.indexOf(t)===0)return n.slice(t.length);var e=t.replace(/^https\:/,"http:");if(n.indexOf(e)===0)return n.slice(e.length);var r=t.replace(/^http\:/,"https:");return n.indexOf(r)===0?n.slice(r.length):(console.warn("".concat(n," is not start with base_url(").concat(t,").")),n)}function panoURL(n,t,e){return!isAbsoluteURL(n)&&typeof t=="string"&&t.length>0&&(n=pathJoin(t,String(e),n)),n}function getTileLevel(n){for(var t=10;t>=0;t--){var e=512*Math.pow(2,t);if(e<=n)return t}return null}function sortTile(n){n=n.slice().sort(function(u,l){return u.level-l.level});for(var t=[],e=0,r=n;e<r.length;e++){var o=r[e];if(t.length===0){t.push(o);continue}var s=t[t.length-1];if(o.level>s.level){t.push(o);continue}if(o.size>s.size){t[t.length-1]=o;continue}}return t}function parse(n,t){for(var e,r,o,s,u,l,c,p,f,d,h,m,A,g,y,v,E,b=[],T=null,_=0,S=[].concat(n);_<S.length;_++){var R=S[_];if("getURL"in R)T={allowHosts:R.allowHosts,expire:R.expire,issuer:R.issuer},b.push(workToJson(R));else{var w=typeof R=="string"?JSON.parse(R):jsonClone(R),M=verify(w);if(M instanceof Error)return M;T===null&&(T=M),b.push(w)}}if(T===null)return new Error("Empty");defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:T.issuer}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(T.expire)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(T.allowHosts)});var B=b.reduce(function(V,J){return jsonMerge(V,J)});defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:String((e=B.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{enumerable:!0,writable:!0,value:String(B.resource_code||B.basic_code||B.vr_code||B.code||B.project_id||B.work_code||B.workCode||createUuid())}),defineProperty(t,"projectId",{enumerable:!0,writable:!0,value:B.project_id}),defineProperty(t,"baseURL",{enumerable:!0,writable:!0,value:(function(){var V,J=(V=B.base_url)!==null&&V!==void 0?V:"";return J&&J[J.length-1]!=="/"&&(J+="/"),J})()});var C=void 0;typeof B.model=="object"&&(C={},defineProperty(C,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(C,"file",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=B.model.file_url;if(V)return relativeURL(V,t.baseURL)})()}),defineProperty(C,"textureBase",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=B.model.material_base_url;return V&&(V=relativeURL(V,t.baseURL)),V})()}),defineProperty(C,"textures",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V=void 0;return Array.isArray(B.model.material_textures)&&(V=B.model.material_textures.slice(),Object.freeze(V)),V})()}),defineProperty(C,"layers",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var V,J,W,X=[];if(Array.isArray(B.model.layers))for(var Z=0,Y=B.model.layers;Z<Y.length;Z++){var G=Y[Z];if(G&&G.tileset_url){var ee={};defineProperty(ee,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(ee,"name",{enumerable:!0,configurable:!1,writable:!1,value:(V=G.name)!==null&&V!==void 0?V:""}),defineProperty(ee,"type",{enumerable:!0,configurable:!1,writable:!1,value:(J=G.type)!==null&&J!==void 0?J:"mesh"}),defineProperty(ee,"upAxis",{enumerable:!0,configurable:!1,writable:!1,value:(W=G.up_axis)!==null&&W!==void 0?W:"Z"}),defineProperty(ee,"tileset",{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(G.tileset_url,t.baseURL)}),X.push(ee)}}if(typeof B.model.tiles=="object"){var G=B.model.tiles;if(G&&G.tileset_url){var ee={};defineProperty(ee,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(ee,"name",{enumerable:!0,configurable:!1,writable:!1,value:"lod"}),defineProperty(ee,"type",{enumerable:!0,configurable:!1,writable:!1,value:"mesh"}),defineProperty(ee,"upAxis",{enumerable:!0,configurable:!1,writable:!1,value:"-Y"}),defineProperty(ee,"tileset",{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(G.tileset_url,t.baseURL)}),X.push(ee)}}return Object.freeze(X)})()})),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:C});var P=[];if(Array.isArray(B.observers)&&B.panorama&&Array.isArray(B.panorama.list||B.panorama.info))for(var L=B.observers,O=(r=B.panorama.list||B.panorama.info)!==null&&r!==void 0?r:[],F=(p=(l=(s=(o=B.panorama)===null||o===void 0?void 0:o.pano_high_cube_base_url)!==null&&s!==void 0?s:(u=B.panorama)===null||u===void 0?void 0:u.pano_cube_base_url)!==null&&l!==void 0?l:(c=B.panorama)===null||c===void 0?void 0:c.base_url)!==null&&p!==void 0?p:"",N=Math.min(L.length,O.length),D=function(V){var J=L[V],W=O[V],X={};defineProperty(X,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(X,"index",{enumerable:!0,configurable:!1,writable:!1,value:V}),defineProperty(X,"panoIndex",{enumerable:!0,configurable:!1,writable:!1,value:V}),defineProperty(X,"panoId",{enumerable:!0,configurable:!1,writable:!1,value:panoStringify({workCode:t.workCode,panoIndex:V})}),defineProperty(X,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:(f=J.derived_id)!==null&&f!==void 0?f:W.derived_id}),defineProperty(X,"floorIndex",{enumerable:!0,configurable:!1,writable:!1,value:(d=J.floor_index)!==null&&d!==void 0?d:J.floor}),defineProperty(X,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:(h=J.derived_id)!==null&&h!==void 0?h:W.derived_id}),defineProperty(X,"derivedIdStr",{enumerable:!0,configurable:!1,writable:!1,value:(m=J.derived_id_str)!==null&&m!==void 0?m:W.derived_id_str}),defineProperty(X,"active",{enumerable:!0,configurable:!1,writable:!1,value:J.active!==!1&&W.active!==!1}),defineProperty(X,"loadable",{enumerable:!0,configurable:!1,writable:!1,value:(g=(A=J.active)!==null&&A!==void 0?A:W.active)!==null&&g!==void 0?g:!1}),defineProperty(X,"position",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((y=J.position)!==null&&y!==void 0?y:[0,0,0]))}),defineProperty(X,"standingPosition",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Vector3().fromArray((E=(v=J.standing_position)!==null&&v!==void 0?v:J.standingPosition)!==null&&E!==void 0?E:[0,0,0]))}),defineProperty(X,"quaternion",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Quaternion().fromArray(J.quaternion?[J.quaternion.x,J.quaternion.y,J.quaternion.z,J.quaternion.w]:[0,0,0,1]))}),defineProperty(X,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new THREE__namespace.Matrix4().compose(X.position,X.quaternion,PANO_TEXTURE_SCALE))}),defineProperty(X,"accessibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z,Y,G=((Y=(Z=J.accessible_nodes)!==null&&Z!==void 0?Z:J.accessibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(te){return te<N});if(G.length===0)for(var ee=0;ee<N;ee++)ee!==V&&G.push(ee);return Object.freeze(G)})()}),defineProperty(X,"visibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z,Y,G=((Y=(Z=J.visible_nodes)!==null&&Z!==void 0?Z:J.visibleNodes)!==null&&Y!==void 0?Y:[]).filter(function(te){return te<N});if(G.length===0)for(var ee=0;ee<N;ee++)ee!==V&&G.push(ee);return Object.freeze(G)})()}),defineProperty(X,"images",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z={};defineProperty(Z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var Y=0,G=FACE_ORDER$1;Y<G.length;Y++){var ee=G[Y];defineProperty(Z,ee,{enumerable:!0,configurable:!1,writable:!1,value:relativeURL(panoURL(W[ee],F,V),t.baseURL)})}return defineProperty(Z,"sizeList",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var te=getImageSizeFromURL(Z[FACE_ORDER$1[0]]);if(te){if(W.size_list){var ne=W.size_list.slice().sort(function(ye,_e){return ye-_e});return Object.freeze(ne)}else if(W.tiles){for(var ne=[te],ae=W.tiles.slice().sort(function(_e,le){return _e-le}),ce=0,ie=ae;ce<ie.length;ce++){var fe=ie[ce],ge=512*Math.pow(2,fe);ge>te&&ne.push(ge)}return Object.freeze(ne)}}return Object.freeze([])})()}),defineProperty(Z,"tiles",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var te=getImageSizeFromURL(Z.front);if(te){var ne=Z.sizeList.slice();if(ne[0]){var ae=getTileLevel(ne[0]);if(ae)for(var ce=ae-1;ce>=0;ce--)ne.unshift(512*Math.pow(2,ce))}if(!(ne.length<=0)){for(var ie=[],fe=0,ge=ne;fe<ge.length;fe++){var ye=ge[fe],_e=getTileLevel(ye);if(typeof _e=="number"){var le={};if(defineProperty(le,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(le,"level",{enumerable:!0,configurable:!1,writable:!1,value:_e}),ye>te){defineProperty(le,"size",{enumerable:!0,configurable:!1,writable:!1,value:ye}),defineProperty(le,"scale",{enumerable:!0,configurable:!1,writable:!1,value:1});for(var de=0,re=FACE_ORDER$1;de<re.length;de++){var se=re[de];defineProperty(le,se,{enumerable:!0,configurable:!1,writable:!1,value:replaceImageSize(Z[se],ye)})}}else{defineProperty(le,"size",{enumerable:!0,configurable:!1,writable:!1,value:te}),defineProperty(le,"scale",{enumerable:!0,configurable:!1,writable:!1,value:ye/te});for(var he=0,me=FACE_ORDER$1;he<me.length;he++){var se=me[he];defineProperty(le,se,{enumerable:!0,configurable:!1,writable:!1,value:Z[se]})}}ie.push(le)}}return ie=sortTile(ie),Object.freeze(ie)}}})()}),Z})()}),defineProperty(X,"video",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var Z=void 0;return W.video&&(Z={},defineProperty(Z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(Z,"source",{enumerable:!0,configurable:!1,writable:!1,value:W.video.source}),defineProperty(Z,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().fromArray(W.video.matrix)}),defineProperty(Z,"size",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector2().fromArray(W.video.size)})),Z})()}),P.push(X)},U=0;U<N;U++)D(U);defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(P)});var z={};if(defineProperty(z,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),B.initial){if(t.observers.length>0){var K=void 0;isNumber(B.initial.panoIndex)?K=B.initial.panoIndex:isNumber(B.initial.pano_index)?K=B.initial.pano_index:isNumber(B.initial.pano)&&(K=B.initial.pano),typeof K=="number"&&(K=clamp$1(K,0,t.observers.length-1),defineProperty(z,"panoIndex",{enumerable:!0,writable:!0,value:K}))}if(B.initial.mode==="Panorama"&&t.observers.length===0||B.initial.mode==="Floorplan"||B.initial.mode==="Topview"||B.initial.mode==="Model"||B.initial.mode==="Mapview"?defineProperty(z,"mode",{enumerable:!0,writable:!0,value:B.initial.mode}):typeof z.panoIndex=="number"?defineProperty(z,"mode",{enumerable:!0,writable:!0,value:"Panorama"}):defineProperty(z,"mode",{enumerable:!0,writable:!0,value:"Mapview"}),isNumber(B.initial.latitude)&&defineProperty(z,"latitude",{enumerable:!0,writable:!0,value:B.initial.latitude}),isNumber(B.initial.longitude)?defineProperty(z,"longitude",{enumerable:!0,writable:!0,value:B.initial.longitude}):isNumber(B.initial.heading)&&defineProperty(z,"longitude",{enumerable:!0,writable:!0,value:headingToLongitude(B.initial.heading)}),isNumber(B.initial.fov)&&defineProperty(z,"fov",{enumerable:!0,writable:!0,value:B.initial.fov}),isNumber(B.initial.distance)&&defineProperty(z,"distance",{enumerable:!0,writable:!0,value:B.initial.distance}),Array.isArray(B.initial.offset)){var j=B.initial.offset,Q=[0,0,0].map(function(V,J){var W=Number(j[J]);return isNaN(W)||!isFinite(W)?0:W});defineProperty(z,"offset",{enumerable:!0,writable:!0,value:new THREE__namespace.Vector3().fromArray(Q)})}else typeof B.initial.offset=="object"&&typeof B.initial.offset.x=="number"&&typeof B.initial.offset.y=="number"&&typeof B.initial.offset.z=="number"&&defineProperty(z,"offset",{enumerable:!0,writable:!0,value:new THREE__namespace.Vector3().fromArray([B.initial.offset.x,B.initial.offset.y,B.initial.offset.z])})}return defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:z}),t}function parseNull(n,t){return defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:"Null"}),defineProperty(t,"workCode",{enumerable:!0,value:createUuid()}),defineProperty(t,"baseURL",{enumerable:!0,value:"/"}),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var e={};return defineProperty(e,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(e,"mode",{enumerable:!0,writable:!0,value:"Mapview"}),e})()}),t}function parsePano(n,t){var e,r;return defineProperty(t,"issuer",{enumerable:!0,configurable:!1,writable:!1,value:"null"}),defineProperty(t,"expire",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(new Date)}),defineProperty(t,"allowHosts",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze(["*"])}),defineProperty(t,"name",{enumerable:!0,configurable:!1,writable:!1,value:String((e=n.name)!==null&&e!==void 0?e:"Unknown")}),defineProperty(t,"workCode",{enumerable:!0,writable:!0,value:(r=n.code)!==null&&r!==void 0?r:createUuid()}),defineProperty(t,"baseURL",{enumerable:!0,writable:!0,value:"/"}),defineProperty(t,"model",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(t,"observers",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"index",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"panoIndex",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"panoId",{enumerable:!0,configurable:!1,writable:!1,value:panoStringify({workCode:t.workCode,panoIndex:0})}),defineProperty(o,"floorIndex",{enumerable:!0,configurable:!1,writable:!1,value:0}),defineProperty(o,"derivedId",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(o,"derivedIdStr",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),defineProperty(o,"active",{enumerable:!0,configurable:!1,writable:!1,value:!0}),defineProperty(o,"loadable",{enumerable:!0,configurable:!1,writable:!1,value:!1}),defineProperty(o,"position",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,1.5,0)}),defineProperty(o,"standingPosition",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Vector3(0,0,0)}),defineProperty(o,"quaternion",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Quaternion(0,1,0,0)}),defineProperty(o,"matrix",{enumerable:!0,configurable:!1,writable:!1,value:new THREE__namespace.Matrix4().compose(o.position,o.quaternion,PANO_TEXTURE_SCALE)}),defineProperty(o,"accessibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"visibleNodes",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([])}),defineProperty(o,"images",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var s={};defineProperty(s,"work",{enumerable:!1,configurable:!1,writable:!1,value:t});for(var u=0,l=FACE_ORDER$1;u<l.length;u++){var c=l[u];defineProperty(s,c,{enumerable:!0,configurable:!1,writable:!1,value:n[c]})}return defineProperty(s,"sizeList",{enumerable:!0,configurable:!1,writable:!1,value:Object.freeze([n.size])}),defineProperty(s,"tiles",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var p=getImageSizeFromURL(s.front);if(p){var f=s.sizeList.slice();if(f[0]){var d=getTileLevel(f[0]);if(d)for(var h=d-1;h>=0;h--)f.unshift(512*Math.pow(2,h))}if(!(f.length<=0)){for(var m=[],A=0,g=f;A<g.length;A++){var y=g[A],v=getTileLevel(y);if(typeof v=="number"){var E={};if(defineProperty(E,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(E,"level",{enumerable:!0,configurable:!1,writable:!1,value:v}),y>p){defineProperty(E,"size",{enumerable:!0,configurable:!1,writable:!1,value:y}),defineProperty(E,"scale",{enumerable:!0,configurable:!1,writable:!1,value:1});for(var b=0,T=FACE_ORDER$1;b<T.length;b++){var _=T[b];defineProperty(E,_,{enumerable:!0,configurable:!1,writable:!1,value:replaceImageSize(s[_],y)})}}else{defineProperty(E,"size",{enumerable:!0,configurable:!1,writable:!1,value:p}),defineProperty(E,"scale",{enumerable:!0,configurable:!1,writable:!1,value:y/p});for(var S=0,R=FACE_ORDER$1;S<R.length;S++){var _=R[S];defineProperty(E,_,{enumerable:!0,configurable:!1,writable:!1,value:s[_]})}}m.push(E)}}return m=sortTile(m),Object.freeze(m)}}})()}),s})()}),defineProperty(o,"video",{enumerable:!0,configurable:!1,writable:!1,value:void 0}),Object.freeze([o])})()}),defineProperty(t,"initial",{enumerable:!0,configurable:!1,writable:!1,value:(function(){var o={};return defineProperty(o,"work",{enumerable:!1,configurable:!1,writable:!1,value:t}),defineProperty(o,"mode",{enumerable:!0,writable:!0,value:"Panorama"}),defineProperty(o,"panoIndex",{enumerable:!0,writable:!0,value:0}),o})()}),t}var workVerifySet=new WeakSet,Work=(function(){function n(t,e){this.observerBox=new THREE__namespace.Box3,this.observerBox=new THREE__namespace.Box3,this.transform=new THREE__namespace.Matrix4,this.shortPath=!1,this.jsonp=!1;var r;if(t!==null?typeof t=="object"&&typeof t.size=="number"&&typeof t.up=="string"&&typeof t.down=="string"&&typeof t.right=="string"&&typeof t.left=="string"&&typeof t.front=="string"&&typeof t.back=="string"?r=parsePano(t,this):r=parse(t,this):r=parseNull(t,this),r instanceof Error)throw new Error("[PARSE FAILED]: "+r.message+`
|
|
1027
1027
|
Error work input:
|
|
1028
|
-
`+JSON.stringify(t));workVerifySet.add(this);for(var o=0,s=this.observers;o<s.length;o++){var u=s[o];this.observerBox.expandByPoint(u.position),this.observerBox.expandByPoint(u.standingPosition)}e.transform&&(Array.isArray(e.transform)?this.transform.fromArray(e.transform):this.transform.copy(e.transform)),typeof e.jsonp=="boolean"&&(this.jsonp=e.jsonp),typeof e.shortPath=="boolean"&&(this.shortPath=e.shortPath),e.workCode&&(typeof e.workCode=="string"?this.workCode=e.workCode:typeof e.workCode=="function"&&(this.workCode=e.workCode(t)));{var l=this;this.options={get transform(){return l.transform}},this.raw={get works(){return[JSON.stringify(workToJson(l))]}}}}return n.prototype.getURL=function(t){var e;if(!isAbsoluteURL(t)){if(this.jsonp===!0){t=t.replace(/([\?\#].*)?$/i,"");var r=sha256("".concat(t)).slice(0,7);t="".concat(t,".").concat(r,".jsonp")}if(this.shortPath===!0){var o=t.replace(t,"").split("."),s=(e=o.shift())!==null&&e!==void 0?e:"",u=o.join(".");t=sha256(s)+(u?"."+u:"")}t=pathJoin(this.baseURL,t)}return t=getFullURL(t),t},n.prototype.verifyURL=function(t){return typeof verifyURL(this.getURL(t),this.allowHosts)=="string"},n.prototype.toJSON=function(){return workToJson(this)},n.parse=parseWork,n})();function parseWork(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));try{return new Work(n,t!=null?t:{})}catch(r){console.log(r);var e=r instanceof Error?r.message:String(r);throw new Error("[PARSE Error]: "+e+`
|
|
1028
|
+
`+JSON.stringify(t));workVerifySet.add(this);for(var o=0,s=this.observers;o<s.length;o++){var u=s[o];this.observerBox.expandByPoint(u.position),this.observerBox.expandByPoint(u.standingPosition)}e.baseURL&&(this.baseURL=e.baseURL),e.transform&&(Array.isArray(e.transform)?this.transform.fromArray(e.transform):this.transform.copy(e.transform)),typeof e.jsonp=="boolean"&&(this.jsonp=e.jsonp),typeof e.shortPath=="boolean"&&(this.shortPath=e.shortPath),e.workCode&&(typeof e.workCode=="string"?this.workCode=e.workCode:typeof e.workCode=="function"&&(this.workCode=e.workCode(t)));{var l=this;this.options={get transform(){return l.transform}},this.raw={get works(){return[JSON.stringify(workToJson(l))]}}}}return n.prototype.getURL=function(t){var e;if(!isAbsoluteURL(t)){if(this.jsonp===!0){t=t.replace(/([\?\#].*)?$/i,"");var r=sha256("".concat(t)).slice(0,7);t="".concat(t,".").concat(r,".jsonp")}if(this.shortPath===!0){var o=t.replace(t,"").split("."),s=(e=o.shift())!==null&&e!==void 0?e:"",u=o.join(".");t=sha256(s)+(u?"."+u:"")}t=pathJoin(this.baseURL,t)}return t=getFullURL(t),t},n.prototype.verifyURL=function(t){return typeof verifyURL(this.getURL(t),this.allowHosts)=="string"},n.prototype.toJSON=function(){return workToJson(this)},n.parse=parseWork,n})();function parseWork(n,t){typeof n=="string"&&n.trim()[0]==="{"&&(n=JSON.parse(n));try{return new Work(n,t!=null?t:{})}catch(r){console.log(r);var e=r instanceof Error?r.message:String(r);throw new Error("[PARSE Error]: "+e+`
|
|
1029
1029
|
Error work input:
|
|
1030
1030
|
`+JSON.stringify(n))}}var scratchMatrix4=new THREE__namespace.Matrix4,WorkResolvedObserver=(function(){function n(t){this.isResolved=!0,this.work=t.work,this.index=t.index,this.panoIndex=t.panoIndex,this.pano={panoIndex:t.panoIndex,workCode:t.work.workCode},this.panoId=panoStringify({panoIndex:t.panoIndex,workCode:t.work.workCode}),this.floorIndex=t.floorIndex,this.derivedId=t.derivedId,this.derivedIdStr=t.derivedIdStr,this.active=t.active,this.loadable=t.loadable,this.images=t.images,this.visibleNodes=t.visibleNodes,this.visibleIds=t.visibleNodes.map(function(e){return panoStringify({panoIndex:e,workCode:t.work.workCode})}),this.accessibleNodes=t.accessibleNodes,this.accessibleIds=t.accessibleNodes.map(function(e){return panoStringify({panoIndex:e,workCode:t.work.workCode})}),this.position=new THREE__namespace.Vector3().copy(t.position).applyMatrix4(t.work.transform),this.standingPosition=new THREE__namespace.Vector3().copy(t.standingPosition).applyMatrix4(t.work.transform),this.quaternion=new THREE__namespace.Quaternion().setFromRotationMatrix(scratchMatrix4.makeRotationFromQuaternion(t.quaternion).premultiply(t.work.transform)),this.matrix=new THREE__namespace.Matrix4().copy(t.matrix).premultiply(t.work.transform)}return n})();function createWorks(n){var t=n.map(function(e){if(workVerifySet.has(e))return e;var r=parseWork(null);return r.workCode=e.workCode,r});return Object.freeze(Object.assign(t,{get initial(){var e;return(e=t[0])===null||e===void 0?void 0:e.initial},getWork:function(e){for(var r=0,o=t;r<o.length;r++){var s=o[r];if(s.workCode===e)return s}},getObserver:function(e){var r,o,s=(r=t[0])===null||r===void 0?void 0:r.workCode,u=0;if(isPanoId(e)){var l=panoParse(e);s=l.workCode,u=l.panoIndex}else typeof e=="number"?u=e:(s=e.workCode,u=e.panoIndex);return(o=this.getWork(s))===null||o===void 0?void 0:o.observers[u]},getResolvedObserver:function(e){var r=this.getObserver(e);if(r)return new WorkResolvedObserver(r)},toJSON:function(){return this.map(function(e){return{work:workToJson(e),transform:e.transform.toArray()}})}}))}var InternalWebGLRenderer=(function(n){__extends(t,n);function t(e){var r=e.preserveDrawingBuffer,o=r===void 0?!0:r,s=e.premultipliedAlpha,u=s===void 0?!0:s,l=e.stencil,c=l===void 0?!0:l,p=e.antialias,f=p===void 0?!1:p,d=e.webgl2,h=e.logarithmicDepthBuffer,m=e.precision,A=e.powerPreference,g=this,y={antialias:f,alpha:!0,depth:!0,preserveDrawingBuffer:o,stencil:c,premultipliedAlpha:u,powerPreference:A},v={logarithmicDepthBuffer:h,precision:m};if(d){var E=document.createElement("canvas"),b=E.getContext("webgl2",y);b?g=n.call(this,__assign(__assign(__assign({},y),v),{antialias:!0,canvas:E,context:b}))||this:(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),g=n.call(this,__assign(__assign({},y),v))||this)}else g=n.call(this,__assign(__assign({},y),v))||this;return g.outputEncoding=THREE__namespace.sRGBEncoding,g.autoClear=!0,g}return t})(THREE__namespace.WebGLRenderer),Clock=(function(){function n(t,e){t===void 0&&(t=!0),e===void 0&&(e=!1),this.elapsedTime=0,this.autoStart=t,this.autoUpdate=e,this.running=t;var r=now();e?defineProperty(this,"currentTime",{get:function(){return now()}}):this.currentTime=r,this.startTime=r,this.oldTime=r}return n.prototype.update=function(t){this.autoUpdate||(this.currentTime=t)},n.prototype.start=function(){this.startTime=this.currentTime,this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},n.prototype.stop=function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},n.prototype.getElapsedTime=function(){return this.getDelta(),this.elapsedTime},n.prototype.getDelta=function(){var t=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(t=(this.currentTime-this.oldTime)/1e3,this.oldTime=this.currentTime,this.elapsedTime+=t),t)},n})(),sharedProjScreenMatrix=new THREE__namespace.Matrix4,sharedFrustum=new THREE__namespace.Frustum,renderResolution=new THREE__namespace.Vector2,clockForMixer=new WeakMap;function updateObject(n){var t=!1;return n.needsRender===!0?(n.needsRender=!1,t=!0):n.mixer&&n.mixer.stats.actions.inUse>0&&(t=!0),t}var Scene=(function(n){__extends(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.needsRender=!1,e}return t.prototype.add=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.add.apply(this,e)},t.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return n.prototype.remove.apply(this,e)},t.prototype.update=function(e,r){var o=!1,s;return r instanceof Camera?(s=r.time,renderResolution.copy(r.resolution)):(s=now(),e.getSize(renderResolution)),sharedProjScreenMatrix.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),sharedFrustum.setFromProjectionMatrix(sharedProjScreenMatrix),this.traverseVisible(function(u){if(u.setResolution&&u.setResolution(renderResolution.x,renderResolution.y),u.setTime&&u.setTime(s),u.mixer instanceof THREE__namespace.AnimationMixer){var l=u.mixer,c=clockForMixer.get(l);c||(c=new Clock,clockForMixer.set(l,c)),c.update(s),l.update(c.getDelta())}if((u instanceof THREE__namespace.Mesh||u instanceof THREE__namespace.Line||u instanceof THREE__namespace.Points)&&(u instanceof THREE__namespace.ImmediateRenderObject||!u.frustumCulled||sharedFrustum.intersectsObject(u))){var p=updateObject(u);p&&(o=!0),u.traverseAncestors(function(f){var d=updateObject(f);d&&(o=!0)})}}),this.needsRender=o,o},t})(THREE__namespace.Scene),easeOut$2=function(n){return n*(2-n)},sharedGeometry2$2=(function(){var n=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]),e=new Uint8Array([0,2,1,2,3,1]),r=new THREE__namespace.BufferGeometry;return r.setAttribute("position",new THREE__namespace.BufferAttribute(n,3)),r.setAttribute("uv",new THREE__namespace.BufferAttribute(t,2)),r.setIndex(new THREE__namespace.BufferAttribute(e,1)),r})(),vertexShader$6=`
|
|
1031
1031
|
varying vec2 vUv;
|
|
@@ -1570,7 +1570,7 @@ void main() {
|
|
|
1570
1570
|
float cameraDepth = length(cameraVertex);
|
|
1571
1571
|
gl_FragColor = packDepthToRGBA(clamp(cameraDepth / maxDepth, 0.0, 1.0));
|
|
1572
1572
|
}
|
|
1573
|
-
`,depthMaterial=new THREE__namespace.ShaderMaterial({vertexShader:depthVertexShader,fragmentShader:depthFragmentShader,uniforms:{maxDepth:new THREE__namespace.Uniform(0)}});function renderDepthCube(n,t,e,r){r===void 0&&(r=1e3),depthMaterial.uniforms.maxDepth.value=r,scratchPrevClearColor.copy(n.getClearColor());var o=n.getClearAlpha(),s=t.overrideMaterial;t.overrideMaterial=depthMaterial,n.setClearColor(clearColor,0),e.update(n,t),n.setClearColor(scratchPrevClearColor,o),t.overrideMaterial=s}var scratchRaycaster$1=new THREE__namespace.Raycaster,scratchVector3$3=new THREE__namespace.Vector3,adjustPanoCircleMeshVectors=[new THREE__namespace.Vector3(0,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(1,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,-Math.sqrt(3)/2).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,+Math.sqrt(3)/2).multiplyScalar(.1)],defaultPanoramaControllerCustomInitArgs=__assign(__assign({},defaultPanoramaLikeControllerCustomInitArgs),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new PanoCircleMesh},adjustPanoCircleMeshPositionBasedOnModel:!1,tileLevelForFov:(function(n,t){var e,r=function(l){return l/180*Math.PI},o=(e=Math.log2)!==null&&e!==void 0?e:(function(l){return Math.log(l)*Math.LOG2E}),s=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,u=Math.max(o(s/512),0);return u<2.3&&u>.1&&(u=1),u=u%1>.75?Math.ceil(u):Math.floor(u),u}),tileAppearDuration:.5,tileMaxRequest:3,flyEffectUseDepthBuffer:!1}),PanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="Panorama",r.initAnimationed=!1,r.maxAccessibleDistance=o.maxAccessibleDistance,r.panoTapTriggerRadius=o.panoTapTriggerRadius,r.panoCircleMeshCreator=o.panoCircleMeshCreator,r.adjustPanoCircleMeshPositionBasedOnModel=o.adjustPanoCircleMeshPositionBasedOnModel,r.tileLevelForFov=o.tileLevelForFov,r.tileAppearDuration=o.tileAppearDuration,r.tileMaxRequest=o.tileMaxRequest,r.flyEffectUseDepthBuffer=o.flyEffectUseDepthBuffer,r.adjustPanoCircleMeshPositionFix=new Map;var s=r.modelScene.parameter.resolveValue(),u=s.pano0,l=s.pano1;u&&(l==null?void 0:l.map)!==u.map&&(r.modelScene.parameter.set({pano0:l}),u.map.dispose());var c=new Set;return u&&c.add(u),l&&c.add(l),r.panoMeshes=new Map,r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:r.modelScene.parameter.resolveValue().pano1,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new THREE__namespace.Matrix4},r.panoPictureObserverMap=new WeakMap,r.textureLoader=new TextureLoader,r.tiling=new Tiling,r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r.accessibleObserverFloorCheckCount=0,r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:defaultPanoramaControllerCustomInitArgs.maxAccessibleDistance,panoTapTriggerRadius:(o=e.panoTapTriggerRadius)!==null&&o!==void 0?o:defaultPanoramaControllerCustomInitArgs.panoTapTriggerRadius,panoCircleMeshCreator:(s=e.panoCircleMeshCreator)!==null&&s!==void 0?s:defaultPanoramaControllerCustomInitArgs.panoCircleMeshCreator,adjustPanoCircleMeshPositionBasedOnModel:(u=e.adjustPanoCircleMeshPositionBasedOnModel)!==null&&u!==void 0?u:defaultPanoramaControllerCustomInitArgs.adjustPanoCircleMeshPositionBasedOnModel,tileLevelForFov:(l=e.tileLevelForFov)!==null&&l!==void 0?l:defaultPanoramaControllerCustomInitArgs.tileLevelForFov,tileAppearDuration:(c=e.tileAppearDuration)!==null&&c!==void 0?c:defaultPanoramaControllerCustomInitArgs.tileAppearDuration,tileMaxRequest:(p=e.tileMaxRequest)!==null&&p!==void 0?p:defaultPanoramaControllerCustomInitArgs.tileMaxRequest,flyEffectUseDepthBuffer:(f=e.flyEffectUseDepthBuffer)!==null&&f!==void 0?f:defaultPanoramaControllerCustomInitArgs.flyEffectUseDepthBuffer})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"Panorama"})},Object.defineProperty(t.prototype,"tileLevel",{get:function(){return this.tiling.level},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=this,o=n.prototype.updateConfiguration.call(this,e);return o===!1?!1:(e.maxAccessibleDistance!==void 0&&this.maxAccessibleDistance!==e.maxAccessibleDistance&&(this.maxAccessibleDistance=e.maxAccessibleDistance),e.panoTapTriggerRadius!==void 0&&this.panoTapTriggerRadius!==e.panoTapTriggerRadius&&(this.panoTapTriggerRadius=e.panoTapTriggerRadius),e.panoCircleMeshCreator!==void 0&&this.panoCircleMeshCreator!==e.panoCircleMeshCreator&&(this.panoCircleMeshCreator=e.panoCircleMeshCreator,this.panoMeshes&&(this.panoMeshes.forEach(function(s){r.helper.remove(s),s.dispose()}),this.panoMeshes.clear())),e.tileLevelForFov!==void 0&&this.tileLevelForFov!==e.tileLevelForFov&&(this.tileLevelForFov=e.tileLevelForFov),e.tileMaxRequest!==void 0&&this.tileMaxRequest!==e.tileMaxRequest&&(this.tileMaxRequest=e.tileMaxRequest),e.flyEffectUseDepthBuffer!==void 0&&this.flyEffectUseDepthBuffer!==e.flyEffectUseDepthBuffer&&(this.flyEffectUseDepthBuffer=e.flyEffectUseDepthBuffer),e.adjustPanoCircleMeshPositionBasedOnModel!==void 0&&this.adjustPanoCircleMeshPositionBasedOnModel!==e.adjustPanoCircleMeshPositionBasedOnModel&&(this.adjustPanoCircleMeshPositionBasedOnModel=e.adjustPanoCircleMeshPositionBasedOnModel,this.adjustPanoCircleMeshPositionBasedOnModel||this.adjustPanoCircleMeshPositionFix.clear()),!0)},t.prototype.destroy=function(){var e=this;n.prototype.destroy.call(this),this.tiling.dispose(),this.modelScene.parameter.set({refinedScreen:null,pano0Depth:null,pano1Depth:null}),this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0),this.locationMotion.dispose(),this.pendingTextureTask=void 0,this.panoMeshes&&(this.panoMeshes.forEach(function(h){e.helper.remove(h),h.dispose()}),this.panoMeshes.clear());var r=this.videoTexture.image;r.pause(),r.oncanplay=noop,r.ontimeupdate=noop,this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=this.modelScene.parameter.resolveValue(),s=o.pano0,u=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var p=c[l],f=this.panoResources[p];if(f.panoPicture){var d=f.panoPicture.map;d&&d!==(s==null?void 0:s.map)&&d!==(u==null?void 0:u.map)&&(d.dispose(),f.panoPicture=null)}delete this.panoResources[p]}},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e=this.tiling.pedding,r=e<=0;return this.initAnimationed&&r},t.prototype.updateWork=function(e,r,o,s){var u=this;this.userAction=s,this.works=e;var l=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}})),c={workCode:l.workCode,panoIndex:l.panoIndex};return this.initAnimationed=!1,this.hideIntersectMesh(),this.moveToPano(c,{effect:o.effect,duration:o.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){u.initAnimationed=!0},moveCancelCallback:function(){u.initAnimationed=!0}},s),!0},t.prototype.updateModel=function(e){this.modelScene=e,this.hideIntersectMesh()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),y=g[0],v=g[1],E=this.panoResourceFromLocationMotionKeyframe(y),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.longitude=this.cameraMotion.value.longitude,h.latitude=this.cameraMotion.value.latitude,h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var R=new THREE__namespace.Vector3().copy(E.position),w=new THREE__namespace.Vector3().copy(b.position),M=this.locationMotion.value.count-v.value.count+1;if(d.progress=M,b.panoPicture&&(M<1?E.panoPicture&&(d.pano0=E.panoPicture):d.pano0=b.panoPicture,d.pano1=b.panoPicture),b.effect==="montage"?d.transition="BLACK":b.effect==="spread"?d.transition="SPREAD":d.transition="FADE",(b.effect==="zoomin"||b.effect==="zoomout")&&(d.progress=Math.pow(M,3)),M<1&&b.effect!=="fly"){if(d.pano0&&E.panoPicture){var B={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:E.panoPicture.matrix.clone().premultiply(E.fixCameraTransform).setPosition(b.position)},C=this.panoPictureObserverMap.get(d.pano0);C&&this.panoPictureObserverMap.set(B,C),d.pano0=B}R.copy(w),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(R.x+(w.x-R.x)*M,R.y+(w.y-R.y)*M,R.z+(w.z-R.z)*M);for(var P=[],L=[],O=0,F=this.locationMotion.keyframes;O<F.length;O++){var N=F[O],D=N.key,U=N.progress;D!==void 0&&(P.push(D),U>this.locationMotion.progress&&L.push(D))}for(var z=0,K=Object.keys(this.panoResources);z<K.length;z++){var j=K[z];if(!(L.indexOf(j)>=0)){var Q=this.panoResources[j];if(Q.panoPicture){var V=Q.panoPicture.map;if(V){if(V===((s=d.pano0)===null||s===void 0?void 0:s.map)||V===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;V.dispose(),Q.panoPicture=null}}P.indexOf(j)>=0||delete this.panoResources[j]}}var J=panoParse(b.panoId);J!==this.currentPano&&(this.currentPano=J,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),isEmptyObject(h)===!1&&this.setCamera(h);var W=this.works.getObserver(this.currentPano),X=this.locationMotion.ended?this.getForwardObserverOrNot(this.camera):null,Z=this.works.getObserver(E.panoId),Y=this.works.getObserver(b.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&W){for(var G=[],ee=W.work.observers,te=0,ne=W.accessibleNodes;te<ne.length;te++){var ae=ne[te],C=ee[ae];C&&G.push(C)}var ce=new Map;if(G.sort(function(ue,Ae){var Ce=ce.get(ue);typeof Ce=="undefined"&&(Ce=ue.standingPosition.distanceTo(W.standingPosition),ce.set(ue,Ce));var Be=ce.get(ue);return typeof Be=="undefined"&&(Be=Ae.standingPosition.distanceTo(W.standingPosition),ce.set(Ae,Be)),Ce-Be}),G.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%G.length;var ie=G[this.accessibleObserverFloorCheckCount],fe=this.modelScene.models.find(function(ue){return ue.work===(ie==null?void 0:ie.work)});if(ie&&fe&&fe.visible){var ge=.3,ye=.05,_e=.005,le=ie.standingPosition.clone().applyMatrix4(ie.work.transform),de=panoStringify({panoIndex:ie.panoIndex,workCode:ie.work.workCode}),re=adjustPanoCircleMeshVectors.map(function(ue){scratchRaycaster$1.ray.origin.copy(le),scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(ue).setY(ge)),scratchRaycaster$1.ray.direction.set(0,-1,0),scratchRaycaster$1.firstHitOnly=!0,scratchRaycaster$1.floorIndex=-1;var Ae=fe.intersectRaycaster(scratchRaycaster$1)[0];return Ae&&Ae.distance-_e<=ge?new THREE__namespace.Vector3().copy(le).setY(Ae.point.y+_e):le});re.sort(function(ue,Ae){return Ae.y-ue.y});var se=re[Math.floor(re.length/2)],he=re.filter(function(ue){return ue.distanceTo(se)<=ye})[0];if(he){var me=new THREE__namespace.Vector4(le.x,le.y,le.z,he.y-le.y),Ne=this.adjustPanoCircleMeshPositionFix.get(de);Ne&&!me.equals(Ne)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(de,me)}}this.accessibleObserverFloorCheckCount++}}var qe=new Map;if(Z)for(var Ye=0,Ve=Z.accessibleNodes;Ye<Ve.length;Ye++){var ae=Ve[Ye],C=Z.work.observers[ae];if(C){var de=panoStringify({panoIndex:C.panoIndex,workCode:C.work.workCode});qe.set(de,C)}}if(Y)for(var ve=0,Ke=Y.accessibleNodes;ve<Ke.length;ve++){var ae=Ke[ve],C=Y.work.observers[ae];if(C){var de=panoStringify({panoIndex:C.panoIndex,workCode:C.work.workCode});qe.set(de,C)}}if(this.panoMeshes.forEach(function(ue,Ae){var Ce=qe.get(Ae);if(Ce){ue.position.copy(Ce.standingPosition).applyMatrix4(Ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Ae);Be&&(scratchVector3$3.set(Be.x,Be.y,Be.z),scratchVector3$3.equals(ue.position)&&(ue.position.y+=Be.w)),ue.scale.setScalar(1.2),qe.delete(Ae)}else o.helper.remove(ue),ue.dispose(),o.panoMeshes.delete(Ae)}),qe.forEach(function(ue,Ae){var Ce=o.panoCircleMeshCreator(panoParse(Ae));Ce.position.copy(ue.standingPosition).applyMatrix4(ue.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Ae);Be&&(scratchVector3$3.set(Be.x,Be.y,Be.z),scratchVector3$3.equals(Ce.position)&&(Ce.position.y+=Be.w)),Ce.scale.setScalar(1.2),o.panoMeshes.set(Ae,Ce),o.helper.add(Ce),qe.delete(Ae)}),this.camera.pose.distance>.1||S)this.panoMeshes.forEach(function(ue){ue.setOpacity(0),ue.setCurrent(!1),ue.updateTime&&ue.updateTime(e,r),ue.visible=!1});else if(W){var Te=W.work.observers,Le=arrayMin(W.accessibleNodes,function(ue){var Ae=Te[ue];return Ae?W.standingPosition.distanceTo(Ae.standingPosition):1/0},!0),Me=Le[1];Me=clamp$1(Me,2.5,1/0);var $e=W.visibleNodes.concat(W.panoIndex).map(function(ue){return panoStringify({panoIndex:ue,workCode:W.work.workCode})}),tt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ue,Ae){var Ce=o.works.getObserver(Ae);if($e.indexOf(Ae)===-1)ue.setCurrent(!1),ue.setOpacity(0);else if(!Ce)ue.setCurrent(!1),ue.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ue.setCurrent(!1),ue.setOpacity(0);else{var Be=ue.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ue.setCurrent(!ue.loading&&ue.progress===0&&X!==null&&panoStringify({panoIndex:X.panoIndex,workCode:X.work.workCode})===Ae),ue.setOpacity(Be<.01?0:clamp$1(Me/Be*1.2,.4,.85));var nt=o.camera.position.clone().setY(ue.position.y),ct=new THREE__namespace.Vector3().copy(ue.position).sub(nt).normalize();if(Ae===panoStringify(o.currentPano)){var bt=clamp$1((.5-nt.distanceTo(ue.position))/.5,0,1);ct.multiplyScalar(1-bt).add(tt.clone().multiplyScalar(bt))}ct.length()>0&&ue.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ct.x,ct.z),0))}ue.updateTime&&ue.updateTime(e,r)})}{var M=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,ke=Math.round(M),Ie=this.modelScene.parameter.pano0,He=this.modelScene.parameter.pano1,Ee=ke===0?Ie:He,C=void 0;if(Ee&&(C=this.works.getObserver(Ee.panoId),C||(C=this.panoPictureObserverMap.get(Ee))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=M<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!C||!Ee||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var we={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(we),this.modelScene.parameter.set("refinedScreen",null)}else{var Pe=getImageSizeLevel(Ee.mapSize),je=Pe+1,Qe=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),We=Math.floor(this.tileLevelForFov(this.camera.fov,Qe)),gt=We>Pe?We:0;this.tiling.setObserver(C);var we={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:Ee.map,panoMatrix:Ee.matrix,panoZoom:Ee.zoom,minLevel:je,level:gt},Je=this.tiling.update(we),At={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:ke,opacity:(Ie==null?void 0:Ie.panoId)===(He==null?void 0:He.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Re=this.modelScene.parameter.refinedScreen;(Je||At.pano!==(Re==null?void 0:Re.pano)||At.opacity!==(Re==null?void 0:Re.opacity))&&this.modelScene.parameter.set("refinedScreen",At)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),W&&W.video&&(this.needsRender=!0),this.intersectMesh&&this.intersectMesh.parent&&W&&W.position.y-W.standingPosition.y>10){var Ue=this.camera.position.distanceTo(this.intersectMesh.position),yt=2*Math.tan(.5*this.camera.fov/180*Math.PI),Ct=Ue*yt/5;this.intersectMesh.scale.setScalar(Ct)}else this.intersectMesh.scale.setScalar(1);{var Et=b.effect,dt=this.modelScene.parameter,Ie=dt.pano0,He=dt.pano1;if(Ie&&He&&Ie!==He&&Et==="fly"&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==Ie.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==He.panoId){var ht=500,ze=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ze&&this.pano0DepthCubeRenderTarget.setSize(ze,ze):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ze&&this.pano1DepthCubeRenderTarget.setSize(ze,ze):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var ut=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);ut.matrix.copy(Ie.matrix),ut.matrixWorld.copy(ut.matrix),ut.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,ut,ht);var rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);rt.matrix.copy(He.matrix),rt.matrixWorld.copy(rt.matrix),rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,rt,ht),this.modelScene.parameter.set({pano0Depth:{panoId:Ie.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:ht},pano1Depth:{panoId:He.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:ht}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],o=this.panoResourceFromLocationMotionKeyframe(r),s=this.works.getObserver(o.panoId);return{workCode:s?s.work.workCode:this.currentPano.workCode,panoIndex:s?s.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:s?s.position.clone().applyMatrix4(s.work.transform):this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fly";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),m={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},A="pano:"+jsonHash([m,h,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var g=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(g))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:{panoIndex:f.panoIndex,workCode:f.work.workCode}}))}var y="move-to-pano-"+p;this.pending.add(y);var v=this.modelScene.parameter,E;if(v.pano0&&v.pano0.map.name===A?E=v.pano0:v.pano1&&v.pano1.map.name===A&&(E=v.pano1),E){var b={panoId:p,effect:c,panoPicture:{panoId:E.panoId,map:E.map,mapSize:E.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};b.panoPicture&&this.panoPictureObserverMap.set(b.panoPicture,f),this.pendingTextureTask=void 0,AnimationFrameLoop.shared.add(function(){s.pending.delete(y),s.doMoveToPano(e,b,r)},!0,1);return}this.pendingTextureTask={panoId:p,hash:A,onLoad:function(_){var S;s.pending.delete(y);var R=_.body;if(s.destroyed)R.dispose();else{R.name=A;var w=Array.isArray(R.image)?R.image[0]:R.image,M=(S=w==null?void 0:w.width)!==null&&S!==void 0?S:2048,B={panoId:p,effect:c,panoPicture:{panoId:p,map:R,mapSize:M,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};B.panoPicture&&s.panoPictureObserverMap.set(B.panoPicture,f),s.doMoveToPano(e,B,r)}},onError:function(_){s.pending.delete(y);var S=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:_,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:S})),s.emit("pano.cancel",createEvent("pano.cancel",{error:_,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:S})),s.emit("error",_),r.moveCancelCallback&&r.moveCancelCallback()}};var T=this.panoMeshes.get(p);T&&T.tap&&T.tap(),this.textureLoader.loadCubeTexture(m,{imageURL:{transform:d,options:h},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(_){var S,R;s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:_,meta:null,pano:e})),((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A&&((R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(_))},this.renderer).then(function(_){var S,R;((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A?(s.pendingTextureTask.onLoad(_),(R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(0),s.pendingTextureTask=void 0,s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:_.meta,pano:e}))):_.body.dispose()}).catch(function(_){var S,R;((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A&&(s.pendingTextureTask.onError(_),(R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(0),s.pendingTextureTask=void 0,s.emit("pano.texture.error",createEvent("pano.texture.error",{error:_,progress:0,meta:null,pano:e})),s.emit("error",_))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial,s=o.duration,u=o.effect,l=o.userAction;e.userAction=l;var c=t.initAnimationEndState(e),p={workCode:c.workCode,panoIndex:c.panoIndex},f={modelAlpha:0},d={perspToOrtho:0},h=!1;e.moveToPano(p,{longitude:c.longitude,latitude:c.latitude,fov:c.fov,effect:u,duration:s,moveStartCallback:function(m){h=!0,e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:f}],s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=__assign(__assign(__assign({},p),{mode:e.mode}),clonePose(e.camera.pose));h===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},l)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,o=1;o<e.length;o++){var s=this.panoResourceFromLocationMotionKeyframe(e[o-1]).position,u=this.panoResourceFromLocationMotionKeyframe(e[o]).position,l=s.distanceTo(u)*(e[o].value.count-e[o-1].value.count);r+=l}return r},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g,y;o===void 0&&(o={});var v=now(),E=createUuid();this.panoResources[E]=r;var b=1,T,_,S;if(this.locationMotion.ended){var R=this.locationMotion.getKeyFrameSegment(v);R[0];var w=R[1],M=this.locationMotion.value,B=((u=this.panoResourceFromLocationMotionKeyframe(w))!==null&&u!==void 0?u:this.camera).position,C=r.position;T=Math.max(B.distanceTo(C),b),_=[{key:w.key,progress:0,value:__assign(__assign({},M),{count:0})},{key:E,progress:1,value:{distance:0,count:1}}],S=0}else{var P=this.locationMotion.getKeyFrameSegment(v),L=P[0],w=P[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(L).position,B=this.panoResourceFromLocationMotionKeyframe(w).position,C=r.position,F=w.value.count-M.count,N=Math.max(O.distanceTo(B),b)*F,D=Math.max(B.distanceTo(C),b);T=N+D,_=[{key:L.key,progress:0,value:__assign({},M)},{key:w.key,progress:N/T,value:w.value},{key:E,progress:1,value:{count:w.value.count+1,distance:0}}];var U=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(_);U===0||U===0?S=0:S=this.locationMotion.getProgressVelocity(v)*U/z}var K=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?T:0),j={longitude:o.longitude,latitude:o.latitude,fov:o.fov},Q=__assign(__assign({},e),{mode:this.mode,longitude:(l=j.longitude)!==null&&l!==void 0?l:this.camera.pose.longitude,latitude:(c=j.latitude)!==null&&c!==void 0?c:this.camera.pose.latitude,fov:(p=j.fov)!==null&&p!==void 0?p:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),V=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:V,progress:0,state:Q,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(Q),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(j,K).catch(noop);else{var J=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=coordinatesToVector({longitude:(f=j.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(d=j.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),X=new THREE__namespace.Object3D;X.lookAt(J);var Z=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion);X.lookAt(W);var Y=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion),G=new THREE__namespace.Matrix4().getInverse(Z).premultiply(Y),ee=this.cameraMotion.value.fov,te=(h=j.fov)!==null&&h!==void 0?h:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=clamp$1(te*ne,1,170),ce=0;ce<_.length-1;ce++){var ie=_[ce].key;if(ie){var fe=this.panoResources[ie];fe&&(fe.fixCameraTransform.copy(G),fe.panoPicture&&(fe.panoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan(ee/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=j.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=j.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(g=j.longitude)!==null&&g!==void 0?g:this.cameraMotion.value.longitude,latitude:(y=j.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:te}}],K).catch(noop)}var ge=this.locationMotion.setKeyframes(_,K,S);ge.then(function(){for(var ye=0,_e=s.modelScene.children;ye<_e.length;ye++){var le=_e[ye];le instanceof Model&&le.show()}var de=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:V,progress:1,state:de,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(de);var re=s.works.getObserver(e);if(re&&re.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var se={map:s.videoTexture,size:re.video.size.clone(),matrix:re.video.matrix.clone(),panoMatrix:re.matrix.clone().premultiply(re.work.transform),alpha:1},he=createUuid(),me=s.videoTexture.image;me.setAttribute("uuid",he),me.oncanplay=noop,me.ontimeupdate=noop,canplayVideo().then(function(qe){qe&&re.video&&me.getAttribute("uuid")===he&&(me.oncanplay=function(){me.oncanplay=noop,me.play()},me.ontimeupdate=function(){me.currentTime>.5&&(me.ontimeupdate=noop,s.panoVideo.setMaterial(se))},me.src=re.video.source)}).catch((function(){me.removeAttribute("uuid")}))}else{var Ne=s.videoTexture.image;Ne.removeAttribute("uuid"),Ne.oncanplay=noop,Ne.ontimeupdate=noop}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:V,progress:0,state:Q,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e,r){var o=this,s=this.works.getObserver(this.currentPano);if(!s)return null;var u=r!=null?r:new THREE__namespace.Raycaster(e.position.clone(),e.getWorldDirection(new THREE__namespace.Vector3));u.params.Points={threshold:.1},u.firstHitOnly=!0,u.floorIndex=-1;var l=s.standingPosition.clone().applyMatrix4(s.work.transform),c=s.position.clone().applyMatrix4(s.work.transform);if(c.distanceTo(u.ray.origin)>1){var p=new THREE__namespace.Raycaster(u.ray.origin,new THREE__namespace.Vector3(0,-1,0));p.firstHitOnly=u.firstHitOnly,p.floorIndex=u.floorIndex;var f=this.modelScene.intersectRaycaster(p)[0];f&&f.distance<=2?l.copy(f.point):l.copy(u.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var d=this.modelScene.intersectRaycaster(u)[0],h=d?d.point:u.ray.origin.clone().add(u.ray.direction.clone().normalize().multiplyScalar(3)),m=h.clone().sub(l).normalize();if(m.length()===0)return null;var A=s.work.observers,g=s.accessibleNodes.filter(function(C){if(C===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var P=A[C];if(!P)return!1;var L=P.standingPosition.clone().applyMatrix4(P.work.transform).project(e);return Math.abs(L.z)>1||Math.abs(L.x)>1||Math.abs(L.y)>1?!1:P.loadable||P.active}),y=new Map,v=g.slice().sort(function(C,P){var L=A[C],O=y.get(L);typeof O=="undefined"&&(O=scratchVector3$3.copy(L.standingPosition).applyMatrix4(L.work.transform).distanceTo(l),y.set(L,O));var F=A[P],N=y.get(F);return typeof N=="undefined"&&(N=scratchVector3$3.copy(F.standingPosition).applyMatrix4(F.work.transform).distanceTo(l),y.set(F,N)),O-N});y.clear();for(var E=0,b=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];E<b.length;E++)for(var T=b[E],_=0,S=v;_<S.length;_++){var R=S[_],w=A[R];if(w){var M=scratchVector3$3.copy(w.standingPosition).applyMatrix4(w.work.transform).sub(l);if(M&&M.length()!==0&&m.angleTo(M)<T)return w}}var B=arrayMin(g.map(function(C){return A[C]}),function(C){var P=scratchVector3$3.copy(C.position).applyMatrix4(C.work.transform);return u.ray.closestPointToPoint(P,new THREE__namespace.Vector3).distanceTo(P)});return B||null},t.prototype.onTapGesture=function(e){var r=this,o;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){var s=e.center.raycaster;s.floorIndex=-1;var u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,c=this.works.getObserver(this.currentPano);if(c){var p=c.work.observers,f=c.accessibleNodes.filter(function(V){if(V===r.currentPano.panoIndex&&c.work.workCode===r.currentPano.workCode)return!1;var J=p[V];if(!J)return!1;var W=scratchVector3$3.copy(J.position).applyMatrix4(J.work.transform);return W.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:J.loadable||J.active}),d=this.modelScene.intersectRaycaster(s)[0];if(d){var h=arrayMin(f,function(V){var J=p[V];if(!J)return 1/0;var W=scratchVector3$3.copy(J.standingPosition).applyMatrix4(J.work.transform);return W.distanceTo(d.point)},!0),m=h[0],A=h[1];typeof m=="number"&&A<this.panoTapTriggerRadius&&(l=(o=p[m])!==null&&o!==void 0?o:null)}if(l||(l=this.getForwardObserverOrNot(this.camera,s)),l&&l.panoId===panoStringify(this.currentPano)&&(l=null),l&&!this.locationMotion.ended)for(var g=0,y=this.locationMotion.keyframes;g<y.length;g++){var v=y[g],E=this.panoResourceFromLocationMotionKeyframe(v);if(E.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},T=Math.PI/6,_=Math.PI/12,S=l.position.clone().applyMatrix4(l.work.transform).setY(0).sub(c.position.clone().applyMatrix4(l.work.transform).setY(0)).normalize(),R=[],w=[],M=[],B=l.work.observers,C=0,P=l.accessibleNodes;C<P.length;C++){var m=P[C];if(l.panoIndex!==m&&!(m===this.currentPano.panoIndex&&l.work.workCode===this.currentPano.workCode)){var L=B[m];if(L){var O=L.position.clone().applyMatrix4(L.work.transform).sub(l.position.clone().applyMatrix4(l.work.transform)).setY(0).normalize();S.angleTo(O)<T&&M.push(O)}}}var F=M.length>0?M:__spreadArray(__spreadArray([],R,!0),w,!0),N=F.slice().sort(function(V,J){return V.angleTo(S)-J.angleTo(S)})[0];if(N&&N.angleTo(u)>_&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4){var D=e.state.fov,U=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(D):this.minLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(D):this.maxLatitude,-Math.PI/2,Math.PI/2);b.latitude=clamp$1(0,U,z)}var K=__assign({},e.state);if(K.workCode=l.work.workCode,K.panoIndex=l.panoIndex,b.longitude!==void 0&&(K.longitude=b.longitude),b.latitude!==void 0&&(K.latitude=b.latitude),b.fov!==void 0&&(K.fov=b.fov),K.distance=0,K.offset=l.position.clone(),e.state=K,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:K,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var j=panoStringify({panoIndex:l.panoIndex,workCode:l.work.workCode}),Q=this.panoMeshes.get(j);Q&&(Q.setDisabled(!1),Q.setLoading(!0))}l&&l.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:K,options:b,error:null}))}}}}},t})(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=(function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}})(),isSafari=(function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}})(),isFirefoxAndroid=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}})(),getChromeVersion=(function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}})(),isChromeWithoutDeviceMotion=(function(){var n=!1;if(getChromeVersion()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],o=e[3];n=parseInt(r,10)===3325&&parseInt(o,10)<148}}return function(){return n}})(),isSafariWithoutDeviceMotion=(function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}})(),isR7=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}})();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=(function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}})();function getOriginFromUrl(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=(function(){function n(r,o,s){var u=o?o[0]:0,l=o?o[1]:0,c=o?o[2]:0,p=o?o[3]:1,f=u+u,d=l+l,h=c+c,m=u*f,A=u*d,g=u*h,y=l*d,v=l*h,E=c*h,b=p*f,T=p*d,_=p*h;return r[0]=1-(y+E),r[1]=A+_,r[2]=g-T,r[3]=0,r[4]=A-_,r[5]=1-(m+E),r[6]=v+b,r[7]=0,r[8]=g+T,r[9]=v-b,r[10]=1-(m+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,o,s){var u=s[0],l=s[1],c=s[2],p,f,d,h,m,A,g,y,v,E,b,T;return o===r?(r[12]=o[0]*u+o[4]*l+o[8]*c+o[12],r[13]=o[1]*u+o[5]*l+o[9]*c+o[13],r[14]=o[2]*u+o[6]*l+o[10]*c+o[14],r[15]=o[3]*u+o[7]*l+o[11]*c+o[15]):(p=o[0],f=o[1],d=o[2],h=o[3],m=o[4],A=o[5],g=o[6],y=o[7],v=o[8],E=o[9],b=o[10],T=o[11],r[0]=p,r[1]=f,r[2]=d,r[3]=h,r[4]=m,r[5]=A,r[6]=g,r[7]=y,r[8]=v,r[9]=E,r[10]=b,r[11]=T,r[12]=p*u+m*l+v*c+o[12],r[13]=f*u+A*l+E*c+o[13],r[14]=d*u+g*l+b*c+o[14],r[15]=h*u+y*l+T*c+o[15]),r}function e(r,o){var s=o[0],u=o[1],l=o[2],c=o[3],p=o[4],f=o[5],d=o[6],h=o[7],m=o[8],A=o[9],g=o[10],y=o[11],v=o[12],E=o[13],b=o[14],T=o[15],_=s*f-u*p,S=s*d-l*p,R=s*h-c*p,w=u*d-l*f,M=u*h-c*f,B=l*h-c*d,C=m*E-A*v,P=m*b-g*v,L=m*T-y*v,O=A*b-g*E,F=A*T-y*E,N=g*T-y*b,D=_*N-S*F+R*O+w*L-M*P+B*C;return D?(D=1/D,r[0]=(f*N-d*F+h*O)*D,r[1]=(l*F-u*N-c*O)*D,r[2]=(E*B-b*M+T*w)*D,r[3]=(g*M-A*B-y*w)*D,r[4]=(d*L-p*N-h*P)*D,r[5]=(s*N-l*L+c*P)*D,r[6]=(b*R-v*B-T*S)*D,r[7]=(m*B-g*R+y*S)*D,r[8]=(p*F-f*L+h*C)*D,r[9]=(u*L-s*F-c*C)*D,r[10]=(v*M-E*R+T*_)*D,r[11]=(A*R-m*M-y*_)*D,r[12]=(f*P-p*O-d*C)*D,r[13]=(s*O-u*P+l*C)*D,r[14]=(E*S-v*w-b*_)*D,r[15]=(m*w-A*S+g*_)*D,r):null}return function(r,o,s){n(r,o),s&&t(r,r,s),e(r,r)}})(),SensorSample=(function(){function n(t,e){t===void 0&&(t=new THREE__namespace.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n})(),ComplementaryFilter=(function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;isTimestampDeltaValid(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new THREE__namespace.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var o=new THREE__namespace.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)",RAD_TO_DEG*getQuaternionAngle(o),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 s=new THREE__namespace.Quaternion;s.copy(this.filterQ),s.multiply(o),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,o=new THREE__namespace.Vector3;return o.copy(t),o.normalize(),r.setFromAxisAngle(o,t.length()*e),r},n})(),PosePredictor=(function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var o=new THREE__namespace.Vector3;o.copy(e),o.normalize();var s=e.length();if(s<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var u=s*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(o,u),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n})(),Distortion=(function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,o=t-this.distort(e);Math.abs(r-e)>1e-4;){var s=t-this.distort(r),u=r-s*((r-e)/(s-o));e=r,r=u,o=s}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,o=0;o<this.coefficients.length;o++)r=e*(r+this.coefficients[o]);return(r+1)*t},n})(),Pose=(function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n})(),FieldOfView=(function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n})(),Sensor=(function(){function n(t,e,r,o){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=r,this.accelerometer=new THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,o),this.posePredictor=new PosePredictor(e,o),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var s=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&s!==null&&s<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var u=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),u),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(function(){var s=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),u=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),s.multiply(u)})(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||(function(){var s=new THREE__namespace.Quaternion;return s.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),s})(),t=this._deviceOrientationQ;var e=new THREE__namespace.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var o=new THREE__namespace.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(t),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Pose;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),o=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(o.left),t.rightProjectionMatrix.set(o.right),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),o=this.onDeviceOrientation_.bind(this);return isIOS()&&isInsideCrossOriginIFrame()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",o):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,o={left:[],right:[]};{var s=t.left.upDegrees*DEG_TO_RAD,u=t.left.downDegrees*DEG_TO_RAD,l=t.left.leftDegrees*DEG_TO_RAD,c=t.left.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.left[0]=p,o.left[1]=0,o.left[2]=0,o.left[3]=0,o.left[4]=0,o.left[5]=f,o.left[6]=0,o.left[7]=0,o.left[8]=-((l-c)*p*.5),o.left[9]=(s-u)*f*.5,o.left[10]=r/(e-r),o.left[11]=-1,o.left[12]=0,o.left[13]=0,o.left[14]=r*e/(e-r),o.left[15]=0}{var s=t.right.upDegrees*DEG_TO_RAD,u=t.right.downDegrees*DEG_TO_RAD,l=t.right.leftDegrees*DEG_TO_RAD,c=t.right.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.right[0]=p,o.right[1]=0,o.right[2]=0,o.right[3]=0,o.right[4]=0,o.right[5]=f,o.right[6]=0,o.right[7]=0,o.right[8]=-((l-c)*p*.5),o.right[9]=(s-u)*f*.5,o.right[10]=r/(e-r),o.right[11]=-1,o.right[12]=0,o.right[13]=0,o.right[14]=r*e/(e-r),o.right[15]=0}return o},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Distortion(t.distortionCoefficients),o=t.screenLensDistance,s=(e.widthMeters-t.interLensDistance)/2,u=t.interLensDistance/2,l=t.baselineLensDistance-e.bevelMeters,c=e.heightMeters-l,p=RAD_TO_DEG*Math.atan(r.distort(s/o)),f=RAD_TO_DEG*Math.atan(r.distort(u/o)),d=RAD_TO_DEG*Math.atan(r.distort(l/o)),h=RAD_TO_DEG*Math.atan(r.distort(c/o)),m=new FieldOfView,A=new FieldOfView;return m.leftDegrees=Math.min(p,t.fov),m.rightDegrees=Math.min(f,t.fov),m.downDegrees=Math.min(d,t.fov),m.upDegrees=Math.min(h,t.fov),A.leftDegrees=m.rightDegrees,A.rightDegrees=m.leftDegrees,A.upDegrees=m.upDegrees,A.downDegrees=m.downDegrees,{left:m,right:A}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.Quaternion;var e=t.alpha,r=t.beta,o=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,o=(o||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new THREE__namespace.Euler(e,r,-o,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,o=t.timeStamp/1e3,s=o-this.previousTimestampS;if(s<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=o;return}else if(s<=MIN_TIMESTEP||s>MAX_TIMESTEP){warnOnce("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=o;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(isR7()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,o)),this.filter.addAccelMeasurement(this.accelerometer,o)),this.previousTimestampS=o},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n})(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=(function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var o=e.renderer.getSize(new THREE__namespace.Vector2);e.renderer.setScissor(0,0,o.width,o.height),e.renderer.setViewport(0,0,o.width,o.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new THREE__namespace.Vector2);if(r.width>r.height){var o=t.autoUpdate;o&&(t.updateMatrixWorld(),t.autoUpdate=!1);var s={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},u={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var l=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.right),this.scale);var c=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=c.left.slice(),this.cameraR.projectionMatrix.elements=c.right.slice(),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(u.x,u.y,u.width,u.height),this.renderer.setScissor(u.x,u.y,u.width,u.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),o&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n})();const cardboard="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+Pizs7P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ktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
|
|
1573
|
+
`,depthMaterial=new THREE__namespace.ShaderMaterial({vertexShader:depthVertexShader,fragmentShader:depthFragmentShader,uniforms:{maxDepth:new THREE__namespace.Uniform(0)}});function renderDepthCube(n,t,e,r){r===void 0&&(r=1e3),depthMaterial.uniforms.maxDepth.value=r,scratchPrevClearColor.copy(n.getClearColor());var o=n.getClearAlpha(),s=t.overrideMaterial;t.overrideMaterial=depthMaterial,n.setClearColor(clearColor,0),e.update(n,t),n.setClearColor(scratchPrevClearColor,o),t.overrideMaterial=s}var scratchRaycaster$1=new THREE__namespace.Raycaster,scratchVector3$3=new THREE__namespace.Vector3,adjustPanoCircleMeshVectors=[new THREE__namespace.Vector3(0,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(1,0,0).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,-Math.sqrt(3)/2).multiplyScalar(.1),new THREE__namespace.Vector3(-.5,0,+Math.sqrt(3)/2).multiplyScalar(.1)],defaultPanoramaControllerCustomInitArgs=__assign(__assign({},defaultPanoramaLikeControllerCustomInitArgs),{maxAccessibleDistance:5,panoTapTriggerRadius:.5,panoCircleMeshCreator:function(n){return new PanoCircleMesh},adjustPanoCircleMeshPositionBasedOnModel:!1,tileLevelForFov:(function(n,t){var e,r=function(l){return l/180*Math.PI},o=(e=Math.log2)!==null&&e!==void 0?e:(function(l){return Math.log(l)*Math.LOG2E}),s=t.height/2/Math.tan(r(n/2))*Math.tan(r(45))*2,u=Math.max(o(s/512),0);return u<2.3&&u>.1&&(u=1),u=u%1>.75?Math.ceil(u):Math.floor(u),u}),tileAppearDuration:.5,tileMaxRequest:3,flyEffectUseDepthBuffer:!1}),PanoramaController=(function(n){__extends(t,n);function t(e){var r=this,o=t.parseArgs(e);r=n.call(this,o)||this,r.mode="Panorama",r.initAnimationed=!1,r.maxAccessibleDistance=o.maxAccessibleDistance,r.panoTapTriggerRadius=o.panoTapTriggerRadius,r.panoCircleMeshCreator=o.panoCircleMeshCreator,r.adjustPanoCircleMeshPositionBasedOnModel=o.adjustPanoCircleMeshPositionBasedOnModel,r.tileLevelForFov=o.tileLevelForFov,r.tileAppearDuration=o.tileAppearDuration,r.tileMaxRequest=o.tileMaxRequest,r.flyEffectUseDepthBuffer=o.flyEffectUseDepthBuffer,r.adjustPanoCircleMeshPositionFix=new Map;var s=r.modelScene.parameter.resolveValue(),u=s.pano0,l=s.pano1;u&&(l==null?void 0:l.map)!==u.map&&(r.modelScene.parameter.set({pano0:l}),u.map.dispose());var c=new Set;return u&&c.add(u),l&&c.add(l),r.panoMeshes=new Map,r.locationMotion=new Motion({count:0,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Motion({modelAlpha:r.modelScene.parameter.resolveValue().modelAlpha}),r.perspToOrthoMotion=new Motion({perspToOrtho:r.camera.perspToOrtho.x}),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),panoPicture:r.modelScene.parameter.resolveValue().pano1,position:r.camera.pose.offset.clone(),effect:"fly",fixCameraTransform:new THREE__namespace.Matrix4},r.panoPictureObserverMap=new WeakMap,r.textureLoader=new TextureLoader,r.tiling=new Tiling,r.panoVideo=new PanoVideo,r.scene.add(r.panoVideo.object),r.accessibleObserverFloorCheckCount=0,r}return t.parseArgs=function(e){var r,o,s,u,l,c,p,f;if(e instanceof t)return e;var d=n.parseArgs.call(this,e);return __assign(__assign({},d),{maxAccessibleDistance:(r=e.maxAccessibleDistance)!==null&&r!==void 0?r:defaultPanoramaControllerCustomInitArgs.maxAccessibleDistance,panoTapTriggerRadius:(o=e.panoTapTriggerRadius)!==null&&o!==void 0?o:defaultPanoramaControllerCustomInitArgs.panoTapTriggerRadius,panoCircleMeshCreator:(s=e.panoCircleMeshCreator)!==null&&s!==void 0?s:defaultPanoramaControllerCustomInitArgs.panoCircleMeshCreator,adjustPanoCircleMeshPositionBasedOnModel:(u=e.adjustPanoCircleMeshPositionBasedOnModel)!==null&&u!==void 0?u:defaultPanoramaControllerCustomInitArgs.adjustPanoCircleMeshPositionBasedOnModel,tileLevelForFov:(l=e.tileLevelForFov)!==null&&l!==void 0?l:defaultPanoramaControllerCustomInitArgs.tileLevelForFov,tileAppearDuration:(c=e.tileAppearDuration)!==null&&c!==void 0?c:defaultPanoramaControllerCustomInitArgs.tileAppearDuration,tileMaxRequest:(p=e.tileMaxRequest)!==null&&p!==void 0?p:defaultPanoramaControllerCustomInitArgs.tileMaxRequest,flyEffectUseDepthBuffer:(f=e.flyEffectUseDepthBuffer)!==null&&f!==void 0?f:defaultPanoramaControllerCustomInitArgs.flyEffectUseDepthBuffer})},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"Panorama"})},Object.defineProperty(t.prototype,"tileLevel",{get:function(){return this.tiling.level},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e){var r=this,o=n.prototype.updateConfiguration.call(this,e);return o===!1?!1:(e.maxAccessibleDistance!==void 0&&this.maxAccessibleDistance!==e.maxAccessibleDistance&&(this.maxAccessibleDistance=e.maxAccessibleDistance),e.panoTapTriggerRadius!==void 0&&this.panoTapTriggerRadius!==e.panoTapTriggerRadius&&(this.panoTapTriggerRadius=e.panoTapTriggerRadius),e.panoCircleMeshCreator!==void 0&&this.panoCircleMeshCreator!==e.panoCircleMeshCreator&&(this.panoCircleMeshCreator=e.panoCircleMeshCreator,this.panoMeshes&&(this.panoMeshes.forEach(function(s){r.helper.remove(s),s.dispose()}),this.panoMeshes.clear())),e.tileLevelForFov!==void 0&&this.tileLevelForFov!==e.tileLevelForFov&&(this.tileLevelForFov=e.tileLevelForFov),e.tileMaxRequest!==void 0&&this.tileMaxRequest!==e.tileMaxRequest&&(this.tileMaxRequest=e.tileMaxRequest),e.flyEffectUseDepthBuffer!==void 0&&this.flyEffectUseDepthBuffer!==e.flyEffectUseDepthBuffer&&(this.flyEffectUseDepthBuffer=e.flyEffectUseDepthBuffer),e.adjustPanoCircleMeshPositionBasedOnModel!==void 0&&this.adjustPanoCircleMeshPositionBasedOnModel!==e.adjustPanoCircleMeshPositionBasedOnModel&&(this.adjustPanoCircleMeshPositionBasedOnModel=e.adjustPanoCircleMeshPositionBasedOnModel,this.adjustPanoCircleMeshPositionBasedOnModel||this.adjustPanoCircleMeshPositionFix.clear()),!0)},t.prototype.destroy=function(){var e=this;n.prototype.destroy.call(this),this.tiling.dispose(),this.modelScene.parameter.set({refinedScreen:null,pano0Depth:null,pano1Depth:null}),this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0),this.locationMotion.dispose(),this.pendingTextureTask=void 0,this.panoMeshes&&(this.panoMeshes.forEach(function(h){e.helper.remove(h),h.dispose()}),this.panoMeshes.clear());var r=this.videoTexture.image;r.pause(),r.oncanplay=noop,r.ontimeupdate=noop,this.scene.remove(this.panoVideo.object),this.panoVideo.setMaterial(null),this.panoVideo.dispose();for(var o=this.modelScene.parameter.resolveValue(),s=o.pano0,u=o.pano1,l=0,c=Object.keys(this.panoResources);l<c.length;l++){var p=c[l],f=this.panoResources[p];if(f.panoPicture){var d=f.panoPicture.map;d&&d!==(s==null?void 0:s.map)&&d!==(u==null?void 0:u.map)&&(d.dispose(),f.panoPicture=null)}delete this.panoResources[p]}},t.prototype.isReady=function(){return this.locationMotion.ended!==!0?!1:n.prototype.isReady.call(this)},t.prototype.isTileReady=function(){var e=this.tiling.pedding,r=e<=0;return this.initAnimationed&&r},t.prototype.updateWork=function(e,r,o,s){var u=this;this.userAction=s,this.works=e;var l=t.initAnimationEndState(__assign(__assign({},this),{initial:{currentState:__assign(__assign({},this.currentPano),this.camera.pose),duration:o.duration,effect:o.effect,state:r,userAction:s}})),c={workCode:l.workCode,panoIndex:l.panoIndex};return this.initAnimationed=!1,this.hideIntersectMesh(),this.moveToPano(c,{effect:o.effect,duration:o.duration,longitude:r.longitude,latitude:r.latitude,fov:r.fov,moveEndCallback:function(){u.initAnimationed=!0},moveCancelCallback:function(){u.initAnimationed=!0}},s),!0},t.prototype.updateModel=function(e){this.modelScene=e,this.hideIntersectMesh()},t.prototype.updateTime=function(e,r){var o=this,s,u,l,c,p,f;if(!this.destroyed){var d={},h={},m=this.locationMotion.keyframes[0],A=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],g=this.locationMotion.getKeyFrameSegment(e),y=g[0],v=g[1],E=this.panoResourceFromLocationMotionKeyframe(y),b=this.panoResourceFromLocationMotionKeyframe(v),T=this.panoResourceFromLocationMotionKeyframe(m),_=this.panoResourceFromLocationMotionKeyframe(A),S=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),h.longitude=this.cameraMotion.value.longitude,h.latitude=this.cameraMotion.value.latitude,h.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),d.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var R=new THREE__namespace.Vector3().copy(E.position),w=new THREE__namespace.Vector3().copy(b.position),M=this.locationMotion.value.count-v.value.count+1;if(d.progress=M,b.panoPicture&&(M<1?E.panoPicture&&(d.pano0=E.panoPicture):d.pano0=b.panoPicture,d.pano1=b.panoPicture),b.effect==="montage"?d.transition="BLACK":b.effect==="spread"?d.transition="SPREAD":d.transition="FADE",(b.effect==="zoomin"||b.effect==="zoomout")&&(d.progress=Math.pow(M,3)),M<1&&b.effect!=="fly"){if(d.pano0&&E.panoPicture){var B={panoId:d.pano0.panoId,map:d.pano0.map,mapSize:d.pano0.mapSize,zoom:d.pano0.zoom,matrix:E.panoPicture.matrix.clone().premultiply(E.fixCameraTransform).setPosition(b.position)},C=this.panoPictureObserverMap.get(d.pano0);C&&this.panoPictureObserverMap.set(B,C),d.pano0=B}R.copy(w),S=!0}h.distance=this.locationMotion.value.distance,h.offset=new THREE__namespace.Vector3(R.x+(w.x-R.x)*M,R.y+(w.y-R.y)*M,R.z+(w.z-R.z)*M);for(var P=[],L=[],O=0,F=this.locationMotion.keyframes;O<F.length;O++){var N=F[O],D=N.key,U=N.progress;D!==void 0&&(P.push(D),U>this.locationMotion.progress&&L.push(D))}for(var z=0,K=Object.keys(this.panoResources);z<K.length;z++){var j=K[z];if(!(L.indexOf(j)>=0)){var Q=this.panoResources[j];if(Q.panoPicture){var V=Q.panoPicture.map;if(V){if(V===((s=d.pano0)===null||s===void 0?void 0:s.map)||V===((u=d.pano1)===null||u===void 0?void 0:u.map))continue;V.dispose(),Q.panoPicture=null}}P.indexOf(j)>=0||delete this.panoResources[j]}}var J=panoParse(b.panoId);J!==this.currentPano&&(this.currentPano=J,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(T.panoId),state:__assign(__assign(__assign(__assign({},panoParse(_.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),h),options:{},progress:this.locationMotion.progress,error:null}))}isEmptyObject(d)===!1&&this.modelScene.parameter.set(d),isEmptyObject(h)===!1&&this.setCamera(h);var W=this.works.getObserver(this.currentPano),X=this.locationMotion.ended?this.getForwardObserverOrNot(this.camera):null,Z=this.works.getObserver(E.panoId),Y=this.works.getObserver(b.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&W){for(var G=[],ee=W.work.observers,te=0,ne=W.accessibleNodes;te<ne.length;te++){var ae=ne[te],C=ee[ae];C&&G.push(C)}var ce=new Map;if(G.sort(function(ue,Ae){var Ce=ce.get(ue);typeof Ce=="undefined"&&(Ce=ue.standingPosition.distanceTo(W.standingPosition),ce.set(ue,Ce));var Be=ce.get(ue);return typeof Be=="undefined"&&(Be=Ae.standingPosition.distanceTo(W.standingPosition),ce.set(Ae,Be)),Ce-Be}),G.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%G.length;var ie=G[this.accessibleObserverFloorCheckCount],fe=this.modelScene.models.find(function(ue){return ue.work===(ie==null?void 0:ie.work)});if(ie&&fe&&fe.visible){var ge=.3,ye=.05,_e=.005,le=ie.standingPosition.clone().applyMatrix4(ie.work.transform),de=panoStringify({panoIndex:ie.panoIndex,workCode:ie.work.workCode}),re=adjustPanoCircleMeshVectors.map(function(ue){scratchRaycaster$1.ray.origin.copy(le),scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(ue).setY(ge)),scratchRaycaster$1.ray.direction.set(0,-1,0),scratchRaycaster$1.firstHitOnly=!0,scratchRaycaster$1.floorIndex=-1;var Ae=fe.intersectRaycaster(scratchRaycaster$1)[0];return Ae&&Ae.distance-_e<=ge?new THREE__namespace.Vector3().copy(le).setY(Ae.point.y+_e):le});re.sort(function(ue,Ae){return Ae.y-ue.y});var se=re[Math.floor(re.length/2)],he=re.filter(function(ue){return ue.distanceTo(se)<=ye})[0];if(he){var me=new THREE__namespace.Vector4(le.x,le.y,le.z,he.y-le.y),Ne=this.adjustPanoCircleMeshPositionFix.get(de);Ne&&!me.equals(Ne)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(de,me)}}this.accessibleObserverFloorCheckCount++}}var qe=new Map;if(Z)for(var Ye=0,Ve=Z.accessibleNodes;Ye<Ve.length;Ye++){var ae=Ve[Ye],C=Z.work.observers[ae];if(C){var de=panoStringify({panoIndex:C.panoIndex,workCode:C.work.workCode});qe.set(de,C)}}if(Y)for(var ve=0,Ke=Y.accessibleNodes;ve<Ke.length;ve++){var ae=Ke[ve],C=Y.work.observers[ae];if(C){var de=panoStringify({panoIndex:C.panoIndex,workCode:C.work.workCode});qe.set(de,C)}}if(this.panoMeshes.forEach(function(ue,Ae){var Ce=qe.get(Ae);if(Ce){ue.position.copy(Ce.standingPosition).applyMatrix4(Ce.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Ae);Be&&(scratchVector3$3.set(Be.x,Be.y,Be.z),scratchVector3$3.equals(ue.position)&&(ue.position.y+=Be.w)),ue.scale.setScalar(1.2),qe.delete(Ae)}else o.helper.remove(ue),ue.dispose(),o.panoMeshes.delete(Ae)}),qe.forEach(function(ue,Ae){var Ce=o.panoCircleMeshCreator(panoParse(Ae));Ce.position.copy(ue.standingPosition).applyMatrix4(ue.work.transform);var Be=o.adjustPanoCircleMeshPositionFix.get(Ae);Be&&(scratchVector3$3.set(Be.x,Be.y,Be.z),scratchVector3$3.equals(Ce.position)&&(Ce.position.y+=Be.w)),Ce.scale.setScalar(1.2),o.panoMeshes.set(Ae,Ce),o.helper.add(Ce),qe.delete(Ae)}),this.camera.pose.distance>.1||S)this.panoMeshes.forEach(function(ue){ue.setOpacity(0),ue.setCurrent(!1),ue.updateTime&&ue.updateTime(e,r),ue.visible=!1});else if(W){var Te=W.work.observers,Le=arrayMin(W.accessibleNodes,function(ue){var Ae=Te[ue];return Ae?W.standingPosition.distanceTo(Ae.standingPosition):1/0},!0),Me=Le[1];Me=clamp$1(Me,2.5,1/0);var $e=W.visibleNodes.concat(W.panoIndex).map(function(ue){return panoStringify({panoIndex:ue,workCode:W.work.workCode})}),tt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(ue,Ae){var Ce=o.works.getObserver(Ae);if($e.indexOf(Ae)===-1)ue.setCurrent(!1),ue.setOpacity(0);else if(!Ce)ue.setCurrent(!1),ue.setOpacity(0);else if(!Ce.loadable&&!Ce.active)ue.setCurrent(!1),ue.setOpacity(0);else{var Be=ue.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);ue.setCurrent(!ue.loading&&ue.progress===0&&X!==null&&panoStringify({panoIndex:X.panoIndex,workCode:X.work.workCode})===Ae),ue.setOpacity(Be<.01?0:clamp$1(Me/Be*1.2,.4,.85));var nt=o.camera.position.clone().setY(ue.position.y),ct=new THREE__namespace.Vector3().copy(ue.position).sub(nt).normalize();if(Ae===panoStringify(o.currentPano)){var bt=clamp$1((.5-nt.distanceTo(ue.position))/.5,0,1);ct.multiplyScalar(1-bt).add(tt.clone().multiplyScalar(bt))}ct.length()>0&&ue.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(ct.x,ct.z),0))}ue.updateTime&&ue.updateTime(e,r)})}{var M=(l=this.modelScene.parameter.progress)!==null&&l!==void 0?l:1,ke=Math.round(M),Ie=this.modelScene.parameter.pano0,He=this.modelScene.parameter.pano1,Ee=ke===0?Ie:He,C=void 0;if(Ee&&(C=this.works.getObserver(Ee.panoId),C||(C=this.panoPictureObserverMap.get(Ee))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=M<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!C||!Ee||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var we={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(we),this.modelScene.parameter.set("refinedScreen",null)}else{var Pe=getImageSizeLevel(Ee.mapSize),je=Pe+1,Qe=new THREE__namespace.Vector2().copy(this.camera.resolution).multiplyScalar(this.camera.pixelRatio),We=Math.floor(this.tileLevelForFov(this.camera.fov,Qe)),gt=We>Pe?We:0;this.tiling.setObserver(C);var we={renderer:this.renderer,resolution:this.camera.resolution,pixelRatio:this.camera.pixelRatio,time:this.camera.time,cameraMatrix:this.camera.matrixWorld,cameraProjectionMatrix:this.camera.projectionMatrix,panoMap:Ee.map,panoMatrix:Ee.matrix,panoZoom:Ee.zoom,minLevel:je,level:gt},Je=this.tiling.update(we),At={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:ke,opacity:(Ie==null?void 0:Ie.panoId)===(He==null?void 0:He.panoId)?1:easeInQuart(Math.abs(((c=this.modelScene.parameter.progress)!==null&&c!==void 0?c:0)-.5)*2)},Re=this.modelScene.parameter.refinedScreen;(Je||At.pano!==(Re==null?void 0:Re.pano)||At.opacity!==(Re==null?void 0:Re.opacity))&&this.modelScene.parameter.set("refinedScreen",At)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),W&&W.video&&(this.needsRender=!0),this.intersectMesh&&this.intersectMesh.parent&&W&&W.position.y-W.standingPosition.y>10){var Ue=this.camera.position.distanceTo(this.intersectMesh.position),yt=2*Math.tan(.5*this.camera.fov/180*Math.PI),Ct=Ue*yt/5;this.intersectMesh.scale.setScalar(Ct)}else this.intersectMesh.scale.setScalar(1);{var Et=b.effect,dt=this.modelScene.parameter,Ie=dt.pano0,He=dt.pano1;if(Ie&&He&&Ie!==He&&Et==="fly"&&this.flyEffectUseDepthBuffer){if(((p=this.modelScene.parameter.pano0Depth)===null||p===void 0?void 0:p.panoId)!==Ie.panoId||((f=this.modelScene.parameter.pano1Depth)===null||f===void 0?void 0:f.panoId)!==He.panoId){var ht=500,ze=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ze&&this.pano0DepthCubeRenderTarget.setSize(ze,ze):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ze&&this.pano1DepthCubeRenderTarget.setSize(ze,ze):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ze,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var ut=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);ut.matrix.copy(Ie.matrix),ut.matrixWorld.copy(ut.matrix),ut.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,ut,ht);var rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);rt.matrix.copy(He.matrix),rt.matrixWorld.copy(rt.matrix),rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,rt,ht),this.modelScene.parameter.set({pano0Depth:{panoId:Ie.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:ht},pano1Depth:{panoId:He.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:ht}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(now())[1],r=this.locationMotion.getKeyFrameSegment(now())[1],o=this.panoResourceFromLocationMotionKeyframe(r),s=this.works.getObserver(o.panoId);return{workCode:s?s.work.workCode:this.currentPano.workCode,panoIndex:s?s.panoIndex:this.currentPano.panoIndex,mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,offset:s?s.position.clone().applyMatrix4(s.work.transform):this.camera.position.clone(),distance:this.locationMotion.value.distance}},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fly";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoId ".concat(JSON.stringify(e)));getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality","sharpen","forceUseExifOrientation","mappings"])),m={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},A="pano:"+jsonHash([m,h,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===A)return;var g=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(g))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:{panoIndex:f.panoIndex,workCode:f.work.workCode}}))}var y="move-to-pano-"+p;this.pending.add(y);var v=this.modelScene.parameter,E;if(v.pano0&&v.pano0.map.name===A?E=v.pano0:v.pano1&&v.pano1.map.name===A&&(E=v.pano1),E){var b={panoId:p,effect:c,panoPicture:{panoId:E.panoId,map:E.map,mapSize:E.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};b.panoPicture&&this.panoPictureObserverMap.set(b.panoPicture,f),this.pendingTextureTask=void 0,AnimationFrameLoop.shared.add(function(){s.pending.delete(y),s.doMoveToPano(e,b,r)},!0,1);return}this.pendingTextureTask={panoId:p,hash:A,onLoad:function(_){var S,R=_.body;if(s.destroyed)R.dispose();else{R.name=A;var w=Array.isArray(R.image)?R.image[0]:R.image,M=(S=w==null?void 0:w.width)!==null&&S!==void 0?S:2048,B={panoId:p,effect:c,panoPicture:{panoId:p,map:R,mapSize:M,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};B.panoPicture&&s.panoPictureObserverMap.set(B.panoPicture,f),s.doMoveToPano(e,B,r)}},onError:function(_){var S=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:_,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:S})),s.emit("pano.cancel",createEvent("pano.cancel",{error:_,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:S})),s.emit("error",_),r.moveCancelCallback&&r.moveCancelCallback()}};var T=this.panoMeshes.get(p);T&&T.tap&&T.tap(),this.textureLoader.loadCubeTexture(m,{imageURL:{transform:d,options:h},format:THREE__namespace.RGBAFormat,viaAjax:!0,fetcher:getFetcher(f.work)},void 0,void 0,function(_){var S,R;s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:_,meta:null,pano:e})),((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A&&((R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(_))},this.renderer).then(function(_){var S,R;s.pending.delete(y),((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A?(s.pendingTextureTask.onLoad(_),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(0)):_.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:_.meta,pano:e}))}).catch(function(_){var S,R;s.pending.delete(y),((S=s.pendingTextureTask)===null||S===void 0?void 0:S.hash)===A&&(s.pendingTextureTask.onError(_),s.pendingTextureTask=void 0,(R=s.panoMeshes.get(p))===null||R===void 0||R.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:_,progress:0,meta:null,pano:e})),s.emit("error",_)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var o=e.initial,s=o.duration,u=o.effect,l=o.userAction;e.userAction=l;var c=t.initAnimationEndState(e),p={workCode:c.workCode,panoIndex:c.panoIndex},f={modelAlpha:0},d={perspToOrtho:0},h=!1;e.moveToPano(p,{longitude:c.longitude,latitude:c.latitude,fov:c.fov,effect:u,duration:s,moveStartCallback:function(m){h=!0,e.perspToOrthoMotion.set(d,s).catch(noop),e.modelAlphaMotion.setKeyframes([{progress:0,value:__assign({},e.modelAlphaMotion.value)},{progress:.6,value:__assign({},e.modelAlphaMotion.value)},{progress:1,value:f}],s).catch(noop),e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction}))},moveEndCallback:function(m){e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()},moveCancelCallback:function(){var m=__assign(__assign(__assign({},p),{mode:e.mode}),clonePose(e.camera.pose));h===!1&&e.emit("initAnimation.start",createEvent("initAnimation.start",{state:m,userAction:e.userAction})),e.emit("initAnimation.end",createEvent("initAnimation.end",{state:m,userAction:e.userAction})),e.initAnimationed=!0,r()}},l)})},t.prototype.panoResourceFromLocationMotionKeyframe=function(e){return this.panoResources[e.key]},t.prototype.locationMotionKeyframesLength=function(e){for(var r=0,o=1;o<e.length;o++){var s=this.panoResourceFromLocationMotionKeyframe(e[o-1]).position,u=this.panoResourceFromLocationMotionKeyframe(e[o]).position,l=s.distanceTo(u)*(e[o].value.count-e[o-1].value.count);r+=l}return r},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g,y;o===void 0&&(o={});var v=now(),E=createUuid();this.panoResources[E]=r;var b=1,T,_,S;if(this.locationMotion.ended){var R=this.locationMotion.getKeyFrameSegment(v);R[0];var w=R[1],M=this.locationMotion.value,B=((u=this.panoResourceFromLocationMotionKeyframe(w))!==null&&u!==void 0?u:this.camera).position,C=r.position;T=Math.max(B.distanceTo(C),b),_=[{key:w.key,progress:0,value:__assign(__assign({},M),{count:0})},{key:E,progress:1,value:{distance:0,count:1}}],S=0}else{var P=this.locationMotion.getKeyFrameSegment(v),L=P[0],w=P[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(L).position,B=this.panoResourceFromLocationMotionKeyframe(w).position,C=r.position,F=w.value.count-M.count,N=Math.max(O.distanceTo(B),b)*F,D=Math.max(B.distanceTo(C),b);T=N+D,_=[{key:L.key,progress:0,value:__assign({},M)},{key:w.key,progress:N/T,value:w.value},{key:E,progress:1,value:{count:w.value.count+1,distance:0}}];var U=this.locationMotionKeyframesLength(this.locationMotion.keyframes),z=this.locationMotionKeyframesLength(_);U===0||U===0?S=0:S=this.locationMotion.getProgressVelocity(v)*U/z}var K=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?T:0),j={longitude:o.longitude,latitude:o.latitude,fov:o.fov},Q=__assign(__assign({},e),{mode:this.mode,longitude:(l=j.longitude)!==null&&l!==void 0?l:this.camera.pose.longitude,latitude:(c=j.latitude)!==null&&c!==void 0?c:this.camera.pose.latitude,fov:(p=j.fov)!==null&&p!==void 0?p:this.camera.pose.fov,offset:r.position.clone(),distance:this.camera.pose.distance}),V=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:V,progress:0,state:Q,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(Q),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(j,K).catch(noop);else{var J=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=coordinatesToVector({longitude:(f=j.longitude)!==null&&f!==void 0?f:this.cameraMotion.value.longitude,latitude:(d=j.latitude)!==null&&d!==void 0?d:this.cameraMotion.value.latitude}),X=new THREE__namespace.Object3D;X.lookAt(J);var Z=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion);X.lookAt(W);var Y=new THREE__namespace.Matrix4().makeRotationFromQuaternion(X.quaternion),G=new THREE__namespace.Matrix4().getInverse(Z).premultiply(Y),ee=this.cameraMotion.value.fov,te=(h=j.fov)!==null&&h!==void 0?h:this.cameraMotion.value.fov,ne=1;r.effect==="zoomin"?ne=1.5:r.effect==="zoomout"&&(ne=.4);for(var ae=clamp$1(te*ne,1,170),ce=0;ce<_.length-1;ce++){var ie=_[ce].key;if(ie){var fe=this.panoResources[ie];fe&&(fe.fixCameraTransform.copy(G),fe.panoPicture&&(fe.panoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan(ee/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(m=j.longitude)!==null&&m!==void 0?m:this.cameraMotion.value.longitude,latitude:(A=j.latitude)!==null&&A!==void 0?A:this.cameraMotion.value.latitude,fov:ae}},{progress:1,value:{longitude:(g=j.longitude)!==null&&g!==void 0?g:this.cameraMotion.value.longitude,latitude:(y=j.latitude)!==null&&y!==void 0?y:this.cameraMotion.value.latitude,fov:te}}],K).catch(noop)}var ge=this.locationMotion.setKeyframes(_,K,S);ge.then(function(){for(var ye=0,_e=s.modelScene.children;ye<_e.length;ye++){var le=_e[ye];le instanceof Model&&le.show()}var de=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:s.camera.pose.distance});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:V,progress:1,state:de,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(de);var re=s.works.getObserver(e);if(re&&re.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var se={map:s.videoTexture,size:re.video.size.clone(),matrix:re.video.matrix.clone(),panoMatrix:re.matrix.clone().premultiply(re.work.transform),alpha:1},he=createUuid(),me=s.videoTexture.image;me.setAttribute("uuid",he),me.oncanplay=noop,me.ontimeupdate=noop,canplayVideo().then(function(qe){qe&&re.video&&me.getAttribute("uuid")===he&&(me.oncanplay=function(){me.oncanplay=noop,me.play()},me.ontimeupdate=function(){me.currentTime>.5&&(me.ontimeupdate=noop,s.panoVideo.setMaterial(se))},me.src=re.video.source)}).catch((function(){me.removeAttribute("uuid")}))}else{var Ne=s.videoTexture.image;Ne.removeAttribute("uuid"),Ne.oncanplay=noop,Ne.ontimeupdate=noop}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:V,progress:0,state:Q,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.getForwardObserverOrNot=function(e,r){var o=this,s=this.works.getObserver(this.currentPano);if(!s)return null;var u=r!=null?r:new THREE__namespace.Raycaster(e.position.clone(),e.getWorldDirection(new THREE__namespace.Vector3));u.params.Points={threshold:.1},u.firstHitOnly=!0,u.floorIndex=-1;var l=s.standingPosition.clone().applyMatrix4(s.work.transform),c=s.position.clone().applyMatrix4(s.work.transform);if(c.distanceTo(u.ray.origin)>1){var p=new THREE__namespace.Raycaster(u.ray.origin,new THREE__namespace.Vector3(0,-1,0));p.firstHitOnly=u.firstHitOnly,p.floorIndex=u.floorIndex;var f=this.modelScene.intersectRaycaster(p)[0];f&&f.distance<=2?l.copy(f.point):l.copy(u.ray.origin).add(new THREE__namespace.Vector3(0,-1.5,0))}var d=this.modelScene.intersectRaycaster(u)[0],h=d?d.point:u.ray.origin.clone().add(u.ray.direction.clone().normalize().multiplyScalar(3)),m=h.clone().sub(l).normalize();if(m.length()===0)return null;var A=s.work.observers,g=s.accessibleNodes.filter(function(C){if(C===o.currentPano.panoIndex&&s.work.workCode===o.currentPano.workCode)return!1;var P=A[C];if(!P)return!1;var L=P.standingPosition.clone().applyMatrix4(P.work.transform).project(e);return Math.abs(L.z)>1||Math.abs(L.x)>1||Math.abs(L.y)>1?!1:P.loadable||P.active}),y=new Map,v=g.slice().sort(function(C,P){var L=A[C],O=y.get(L);typeof O=="undefined"&&(O=scratchVector3$3.copy(L.standingPosition).applyMatrix4(L.work.transform).distanceTo(l),y.set(L,O));var F=A[P],N=y.get(F);return typeof N=="undefined"&&(N=scratchVector3$3.copy(F.standingPosition).applyMatrix4(F.work.transform).distanceTo(l),y.set(F,N)),O-N});y.clear();for(var E=0,b=[Math.PI/8,Math.PI/6,Math.PI/4,Math.PI/3];E<b.length;E++)for(var T=b[E],_=0,S=v;_<S.length;_++){var R=S[_],w=A[R];if(w){var M=scratchVector3$3.copy(w.standingPosition).applyMatrix4(w.work.transform).sub(l);if(M&&M.length()!==0&&m.angleTo(M)<T)return w}}var B=arrayMin(g.map(function(C){return A[C]}),function(C){var P=scratchVector3$3.copy(C.position).applyMatrix4(C.work.transform);return u.ray.closestPointToPoint(P,new THREE__namespace.Vector3).distanceTo(P)});return B||null},t.prototype.onTapGesture=function(e){var r=this,o;if(this.userAction=e.userAction,this.stopMomentumMovement(),!!this.initAnimationed){var s=e.center.raycaster;s.floorIndex=-1;var u=this.camera.getDirection(new THREE__namespace.Vector3).setY(0),l=null,c=this.works.getObserver(this.currentPano);if(c){var p=c.work.observers,f=c.accessibleNodes.filter(function(V){if(V===r.currentPano.panoIndex&&c.work.workCode===r.currentPano.workCode)return!1;var J=p[V];if(!J)return!1;var W=scratchVector3$3.copy(J.position).applyMatrix4(J.work.transform);return W.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:J.loadable||J.active}),d=this.modelScene.intersectRaycaster(s)[0];if(d){var h=arrayMin(f,function(V){var J=p[V];if(!J)return 1/0;var W=scratchVector3$3.copy(J.standingPosition).applyMatrix4(J.work.transform);return W.distanceTo(d.point)},!0),m=h[0],A=h[1];typeof m=="number"&&A<this.panoTapTriggerRadius&&(l=(o=p[m])!==null&&o!==void 0?o:null)}if(l||(l=this.getForwardObserverOrNot(this.camera,s)),l&&l.panoId===panoStringify(this.currentPano)&&(l=null),l&&!this.locationMotion.ended)for(var g=0,y=this.locationMotion.keyframes;g<y.length;g++){var v=y[g],E=this.panoResourceFromLocationMotionKeyframe(v);if(E.panoId===l.panoId){l=null;break}}if(!l)this.emit("gesture.tap",e),e.defaultPrevented||this.locationMotion.ended===!0&&this.cameraBounce();else{for(var b={},T=Math.PI/6,_=Math.PI/12,S=l.position.clone().applyMatrix4(l.work.transform).setY(0).sub(c.position.clone().applyMatrix4(l.work.transform).setY(0)).normalize(),R=[],w=[],M=[],B=l.work.observers,C=0,P=l.accessibleNodes;C<P.length;C++){var m=P[C];if(l.panoIndex!==m&&!(m===this.currentPano.panoIndex&&l.work.workCode===this.currentPano.workCode)){var L=B[m];if(L){var O=L.position.clone().applyMatrix4(L.work.transform).sub(l.position.clone().applyMatrix4(l.work.transform)).setY(0).normalize();S.angleTo(O)<T&&M.push(O)}}}var F=M.length>0?M:__spreadArray(__spreadArray([],R,!0),w,!0),N=F.slice().sort(function(V,J){return V.angleTo(S)-J.angleTo(S)})[0];if(N&&N.angleTo(u)>_&&(b.longitude=Math.atan2(-N.x,-N.z)),this.cameraMotion.value.latitude<-Math.PI/4){var D=e.state.fov,U=clamp$1(typeof this.minLatitude=="function"?this.minLatitude(D):this.minLatitude,-Math.PI/2,Math.PI/2),z=clamp$1(typeof this.maxLatitude=="function"?this.maxLatitude(D):this.maxLatitude,-Math.PI/2,Math.PI/2);b.latitude=clamp$1(0,U,z)}var K=__assign({},e.state);if(K.workCode=l.work.workCode,K.panoIndex=l.panoIndex,b.longitude!==void 0&&(K.longitude=b.longitude),b.latitude!==void 0&&(K.latitude=b.latitude),b.fov!==void 0&&(K.fov=b.fov),K.distance=0,K.offset=l.position.clone(),e.state=K,this.emit("gesture.tap",e),!e.defaultPrevented){if(this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:K,userAction:e.userAction,options:b,progress:0,error:null})),l&&!l.active){var j=panoStringify({panoIndex:l.panoIndex,workCode:l.work.workCode}),Q=this.panoMeshes.get(j);Q&&(Q.setDisabled(!1),Q.setLoading(!0))}l&&l.active&&this.emit("pano.request",createEvent("pano.request",{userAction:e.userAction,prevPano:this.currentPano,progress:0,state:K,options:b,error:null}))}}}}},t})(PanoramaLikeController),DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,MIN_TIMESTEP=.001,MAX_TIMESTEP=1,isIOS=(function(){var n=typeof navigator!="undefined"&&/iPad|iPhone|iPod/.test(navigator.platform);return function(){return n}})(),isSafari=(function(){var n=typeof navigator!="undefined"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return n}})(),isFirefoxAndroid=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return n}})(),getChromeVersion=(function(){var n=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9]+)/):null,t=n?parseInt(n[1],10):null;return function(){return t}})(),isChromeWithoutDeviceMotion=(function(){var n=!1;if(getChromeVersion()===65){var t=typeof navigator!="undefined"?navigator.userAgent.match(/.*Chrome\/([0-9\.]*)/):null;if(t){var e=t[1].split(".");e[0],e[1];var r=e[2],o=e[3];n=parseInt(r,10)===3325&&parseInt(o,10)<148}}return function(){return n}})(),isSafariWithoutDeviceMotion=(function(){var n=isIOS()&&isSafari()&&typeof navigator!="undefined"&&navigator.userAgent.indexOf("13_4")!==-1;return function(){return n}})(),isR7=(function(){var n=typeof navigator!="undefined"&&navigator.userAgent.indexOf("R7 Build")!==-1;return function(){return n}})();function isLandscapeMode(){var n=typeof window!="undefined"&&(window.orientation==90||window.orientation==-90);return isR7()?!n:n}function isTimestampDeltaValid(n){return!(isNaN(n)||n<=MIN_TIMESTEP||n>MAX_TIMESTEP)}function getQuaternionAngle(n){if(n.w>1)return 0;var t=2*Math.acos(n.w);return t}var warnOnce=(function(){var n={};return function(t,e){n[t]===void 0&&(console.warn("cardboard: "+e),n[t]=!0)}})();function getOriginFromUrl(n){var t,e=n.indexOf("://");e!==-1?t=e+3:t=0;var r=n.indexOf("/",t);return r===-1&&(r=n.length),n.substring(0,r)}function isInsideCrossOriginIFrame(){if(typeof window=="undefined"||typeof document=="undefined")return!1;var n=window.self!==window.top,t=getOriginFromUrl(document.referrer),e=getOriginFromUrl(window.location.href);return n&&t!==e}var updateEyeViewMatrices=(function(){function n(r,o,s){var u=o?o[0]:0,l=o?o[1]:0,c=o?o[2]:0,p=o?o[3]:1,f=u+u,d=l+l,h=c+c,m=u*f,A=u*d,g=u*h,y=l*d,v=l*h,E=c*h,b=p*f,T=p*d,_=p*h;return r[0]=1-(y+E),r[1]=A+_,r[2]=g-T,r[3]=0,r[4]=A-_,r[5]=1-(m+E),r[6]=v+b,r[7]=0,r[8]=g+T,r[9]=v-b,r[10]=1-(m+y),r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function t(r,o,s){var u=s[0],l=s[1],c=s[2],p,f,d,h,m,A,g,y,v,E,b,T;return o===r?(r[12]=o[0]*u+o[4]*l+o[8]*c+o[12],r[13]=o[1]*u+o[5]*l+o[9]*c+o[13],r[14]=o[2]*u+o[6]*l+o[10]*c+o[14],r[15]=o[3]*u+o[7]*l+o[11]*c+o[15]):(p=o[0],f=o[1],d=o[2],h=o[3],m=o[4],A=o[5],g=o[6],y=o[7],v=o[8],E=o[9],b=o[10],T=o[11],r[0]=p,r[1]=f,r[2]=d,r[3]=h,r[4]=m,r[5]=A,r[6]=g,r[7]=y,r[8]=v,r[9]=E,r[10]=b,r[11]=T,r[12]=p*u+m*l+v*c+o[12],r[13]=f*u+A*l+E*c+o[13],r[14]=d*u+g*l+b*c+o[14],r[15]=h*u+y*l+T*c+o[15]),r}function e(r,o){var s=o[0],u=o[1],l=o[2],c=o[3],p=o[4],f=o[5],d=o[6],h=o[7],m=o[8],A=o[9],g=o[10],y=o[11],v=o[12],E=o[13],b=o[14],T=o[15],_=s*f-u*p,S=s*d-l*p,R=s*h-c*p,w=u*d-l*f,M=u*h-c*f,B=l*h-c*d,C=m*E-A*v,P=m*b-g*v,L=m*T-y*v,O=A*b-g*E,F=A*T-y*E,N=g*T-y*b,D=_*N-S*F+R*O+w*L-M*P+B*C;return D?(D=1/D,r[0]=(f*N-d*F+h*O)*D,r[1]=(l*F-u*N-c*O)*D,r[2]=(E*B-b*M+T*w)*D,r[3]=(g*M-A*B-y*w)*D,r[4]=(d*L-p*N-h*P)*D,r[5]=(s*N-l*L+c*P)*D,r[6]=(b*R-v*B-T*S)*D,r[7]=(m*B-g*R+y*S)*D,r[8]=(p*F-f*L+h*C)*D,r[9]=(u*L-s*F-c*C)*D,r[10]=(v*M-E*R+T*_)*D,r[11]=(A*R-m*M-y*_)*D,r[12]=(f*P-p*O-d*C)*D,r[13]=(s*O-u*P+l*C)*D,r[14]=(E*S-v*w-b*_)*D,r[15]=(m*w-A*S+g*_)*D,r):null}return function(r,o,s){n(r,o),s&&t(r,r,s),e(r,r)}})(),SensorSample=(function(){function n(t,e){t===void 0&&(t=new THREE__namespace.Vector3),e===void 0&&(e=0),this.sample=t,this.timestampS=e}return n.prototype.set=function(t,e){this.sample=t,this.timestampS=e},n.prototype.copy=function(t){this.set(t.sample,t.timestampS)},n})(),ComplementaryFilter=(function(){function n(t,e){this.kFilter=t,this.isDebug=e,this.currentAccelMeasurement=new SensorSample,this.currentGyroMeasurement=new SensorSample,this.previousGyroMeasurement=new SensorSample,isIOS()?this.filterQ=new THREE__namespace.Quaternion(-1,0,0,1):this.filterQ=new THREE__namespace.Quaternion(1,0,0,1),this.previousFilterQ=new THREE__namespace.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new THREE__namespace.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new THREE__namespace.Vector3,this.measuredGravity=new THREE__namespace.Vector3,this.gyroIntegralQ=new THREE__namespace.Quaternion}return n.prototype.addAccelMeasurement=function(t,e){this.currentAccelMeasurement.set(t,e)},n.prototype.addGyroMeasurement=function(t,e){this.currentGyroMeasurement.set(t,e);var r=e-this.previousGyroMeasurement.timestampS;isTimestampDeltaValid(r)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},n.prototype.getOrientation=function(){return this.filterQ},n.prototype.run_=function(){if(!this.isOrientationInitialized){this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),this.isOrientationInitialized=!0;return}var t=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,e=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,t);this.gyroIntegralQ.multiply(e),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(e);var r=new THREE__namespace.Quaternion;r.copy(this.filterQ),r.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(r),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var o=new THREE__namespace.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)",RAD_TO_DEG*getQuaternionAngle(o),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 s=new THREE__namespace.Quaternion;s.copy(this.filterQ),s.multiply(o),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},n.prototype.accelToQuaternion_=function(t){var e=new THREE__namespace.Vector3;e.copy(t),e.normalize();var r=new THREE__namespace.Quaternion;return r.setFromUnitVectors(new THREE__namespace.Vector3(0,0,-1),e),r.inverse(),r},n.prototype.gyroToQuaternionDelta_=function(t,e){var r=new THREE__namespace.Quaternion,o=new THREE__namespace.Vector3;return o.copy(t),o.normalize(),r.setFromAxisAngle(o,t.length()*e),r},n})(),PosePredictor=(function(){function n(t,e){this.predictionTimeS=t,this.isDebug=e,this.previousQ=new THREE__namespace.Quaternion,this.previousTimestampS=null,this.deltaQ=new THREE__namespace.Quaternion,this.outQ=new THREE__namespace.Quaternion}return n.prototype.getPrediction=function(t,e,r){if(!this.previousTimestampS)return this.previousQ.copy(t),this.previousTimestampS=r,t;var o=new THREE__namespace.Vector3;o.copy(e),o.normalize();var s=e.length();if(s<DEG_TO_RAD*20)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(RAD_TO_DEG*s).toFixed(1)),this.outQ.copy(t),this.previousQ.copy(t),this.outQ;var u=s*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(o,u),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(t),this.previousTimestampS=r,this.outQ},n})(),Distortion=(function(){function n(t){this.coefficients=t}return n.prototype.distortInverse=function(t){for(var e=0,r=1,o=t-this.distort(e);Math.abs(r-e)>1e-4;){var s=t-this.distort(r),u=r-s*((r-e)/(s-o));e=r,r=u,o=s}return r},n.prototype.distort=function(t){for(var e=t*t,r=0,o=0;o<this.coefficients.length;o++)r=e*(r+this.coefficients[o]);return(r+1)*t},n})(),Pose=(function(){function n(){this.angularAcceleration=null,this.angularVelocity=null,this.linearAcceleration=null,this.linearVelocity=null,this.orientation=null,this.position=null}return n})(),FieldOfView=(function(){function n(){this.leftDegrees=0,this.rightDegrees=0,this.upDegrees=0,this.downDegrees=0}return n})(),Sensor=(function(){function n(t,e,r,o){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=r,this.accelerometer=new THREE__namespace.Vector3,this.gyroscope=new THREE__namespace.Vector3,this.filter=new ComplementaryFilter(t,o),this.posePredictor=new PosePredictor(e,o),this.isFirefoxAndroid=isFirefoxAndroid(),this.isIOS=isIOS();var s=getChromeVersion();this.isDeviceMotionInRadians=!this.isIOS&&s!==null&&s<66,this.isWithoutDeviceMotion=isChromeWithoutDeviceMotion()||isSafariWithoutDeviceMotion(),this.filterToWorldQ=new THREE__namespace.Quaternion,isIOS()?this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new THREE__namespace.Quaternion,this.worldToScreenQ=new THREE__namespace.Quaternion,this.originalPoseAdjustQ=new THREE__namespace.Quaternion;var u=typeof window!="undefined"?-window.orientation*Math.PI/180:0;this.originalPoseAdjustQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),u),this.setScreenTransform_(),isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new THREE__namespace.Quaternion,this.orientationOut_=new Float32Array(4),this.previousTimestampS=Date.now()}return n.prototype.getPosition=function(){return null},n.prototype.getOrientation=function(){var t;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ){this.deviceOrientationFixQ=this.deviceOrientationFixQ||(function(){var s=new THREE__namespace.Quaternion().setFromAxisAngle(new THREE__namespace.Vector3(0,0,-1),0),u=new THREE__namespace.Quaternion;return typeof window!="undefined"&&window.orientation===-90?u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/-2):u.setFromAxisAngle(new THREE__namespace.Vector3(0,1,0),Math.PI/2),s.multiply(u)})(),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||(function(){var s=new THREE__namespace.Quaternion;return s.setFromAxisAngle(new THREE__namespace.Vector3(1,0,0),-Math.PI/2),s})(),t=this._deviceOrientationQ;var e=new THREE__namespace.Quaternion;return e.copy(t),e.multiply(this.deviceOrientationFilterToWorldQ),e.multiply(this.resetQ),e.multiply(this.worldToScreenQ),e.multiplyQuaternions(this.deviceOrientationFixQ,e),this.yawOnly&&(e.x=0,e.z=0,e.normalize()),this.orientationOut_[0]=e.x,this.orientationOut_[1]=e.y,this.orientationOut_[2]=e.z,this.orientationOut_[3]=e.w,this.orientationOut_}else{var r=this.filter.getOrientation();t=this.posePredictor.getPrediction(r,this.gyroscope,this.previousTimestampS)}var o=new THREE__namespace.Quaternion;return o.copy(this.filterToWorldQ),o.multiply(this.resetQ),o.multiply(t),o.multiply(this.worldToScreenQ),this.yawOnly&&(o.x=0,o.z=0,o.normalize()),this.orientationOut_[0]=o.x,this.orientationOut_[1]=o.y,this.orientationOut_[2]=o.z,this.orientationOut_[3]=o.w,this.orientationOut_},n.prototype.getPose=function(){var t=new Pose;return t.orientation=this.getOrientation(),t},n.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},n.prototype.getFrameData=function(t){var e=this.getOrientation(),r=this.getEyeOffset(),o=this.getEyeProjectionMatrix();return t.pose.angularAcceleration=null,t.pose.angularVelocity=null,t.pose.linearAcceleration=null,t.pose.linearVelocity=null,t.pose.orientation=e,t.pose.position=null,t.timestamp=this.previousTimestampS,t.leftProjectionMatrix.set(o.left),t.rightProjectionMatrix.set(o.right),updateEyeViewMatrices(t.leftViewMatrix,e,r.left),updateEyeViewMatrices(t.rightViewMatrix,e,r.right),t},n.prototype.start=function(){if(typeof window=="undefined")return function(){};var t=this.onDeviceMotion_.bind(this),e=this.onOrientationChange_.bind(this),r=this.onMessage_.bind(this),o=this.onDeviceOrientation_.bind(this);return isIOS()&&isInsideCrossOriginIFrame()&&window.addEventListener("message",r),window.addEventListener("orientationchange",e),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",o):window.addEventListener("devicemotion",t),function(){window.removeEventListener("devicemotion",t),window.removeEventListener("deviceorientation",e),window.removeEventListener("orientationchange",e),window.removeEventListener("message",r)}},n.prototype.getEyeOffset=function(){return{left:[-this.viewer.interLensDistance*.5,0,0],right:[this.viewer.interLensDistance*.5,0,0]}},n.prototype.getEyeProjectionMatrix=function(){var t=this.getEyeFieldOfView(),e=this.depthNear,r=this.depthFar,o={left:[],right:[]};{var s=t.left.upDegrees*DEG_TO_RAD,u=t.left.downDegrees*DEG_TO_RAD,l=t.left.leftDegrees*DEG_TO_RAD,c=t.left.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.left[0]=p,o.left[1]=0,o.left[2]=0,o.left[3]=0,o.left[4]=0,o.left[5]=f,o.left[6]=0,o.left[7]=0,o.left[8]=-((l-c)*p*.5),o.left[9]=(s-u)*f*.5,o.left[10]=r/(e-r),o.left[11]=-1,o.left[12]=0,o.left[13]=0,o.left[14]=r*e/(e-r),o.left[15]=0}{var s=t.right.upDegrees*DEG_TO_RAD,u=t.right.downDegrees*DEG_TO_RAD,l=t.right.leftDegrees*DEG_TO_RAD,c=t.right.rightDegrees*DEG_TO_RAD,p=2/(l+c),f=2/(s+u);o.right[0]=p,o.right[1]=0,o.right[2]=0,o.right[3]=0,o.right[4]=0,o.right[5]=f,o.right[6]=0,o.right[7]=0,o.right[8]=-((l-c)*p*.5),o.right[9]=(s-u)*f*.5,o.right[10]=r/(e-r),o.right[11]=-1,o.right[12]=0,o.right[13]=0,o.right[14]=r*e/(e-r),o.right[15]=0}return o},n.prototype.getEyeFieldOfView=function(){var t=this.viewer,e=this.device,r=new Distortion(t.distortionCoefficients),o=t.screenLensDistance,s=(e.widthMeters-t.interLensDistance)/2,u=t.interLensDistance/2,l=t.baselineLensDistance-e.bevelMeters,c=e.heightMeters-l,p=RAD_TO_DEG*Math.atan(r.distort(s/o)),f=RAD_TO_DEG*Math.atan(r.distort(u/o)),d=RAD_TO_DEG*Math.atan(r.distort(l/o)),h=RAD_TO_DEG*Math.atan(r.distort(c/o)),m=new FieldOfView,A=new FieldOfView;return m.leftDegrees=Math.min(p,t.fov),m.rightDegrees=Math.min(f,t.fov),m.downDegrees=Math.min(d,t.fov),m.upDegrees=Math.min(h,t.fov),A.leftDegrees=m.rightDegrees,A.rightDegrees=m.leftDegrees,A.upDegrees=m.upDegrees,A.downDegrees=m.downDegrees,{left:m,right:A}},n.prototype.onDeviceOrientation_=function(t){this._deviceOrientationQ=this._deviceOrientationQ||new THREE__namespace.Quaternion;var e=t.alpha,r=t.beta,o=t.gamma;e=(e||0)*Math.PI/180,r=(r||0)*Math.PI/180,o=(o||0)*Math.PI/180,this._deviceOrientationQ.setFromEuler(new THREE__namespace.Euler(e,r,-o,"YXZ"))},n.prototype.onDeviceMotion_=function(t){this.updateDeviceMotion_(t)},n.prototype.updateDeviceMotion_=function(t){var e=t.accelerationIncludingGravity,r=t.rotationRate,o=t.timeStamp/1e3,s=o-this.previousTimestampS;if(s<0){warnOnce("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),this.previousTimestampS=o;return}else if(s<=MIN_TIMESTEP||s>MAX_TIMESTEP){warnOnce("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),this.previousTimestampS=o;return}e&&(this.accelerometer.set(-e.x,-e.y,-e.z),r&&(isR7()?this.gyroscope.set(-r.beta,r.alpha,r.gamma):this.gyroscope.set(r.alpha,r.beta,r.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,o)),this.filter.addAccelMeasurement(this.accelerometer,o)),this.previousTimestampS=o},n.prototype.onOrientationChange_=function(){this.setScreenTransform_()},n.prototype.onMessage_=function(t){var e=t.data;if(!(!e||!e.type)){var r=e.type.toLowerCase();r==="devicemotion"&&this.updateDeviceMotion_(e.deviceMotionEvent)}},n.prototype.setScreenTransform_=function(){this.worldToScreenQ.set(0,0,0,1);var t=typeof window!="undefined"?window.orientation:0;switch(t){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new THREE__namespace.Vector3(0,0,1),Math.PI/2);break}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},n})(),defaultLeftBounds=[0,0,.5,1],defaultRightBounds=[.5,0,.5,1],Cardboard=(function(){function n(t){var e=this;this.renderer=t,this.sensor=new Sensor(.98,.04,!1,!1),this.scale=1,this.cameraL=new THREE__namespace.PerspectiveCamera,this.cameraR=new THREE__namespace.PerspectiveCamera;var r=this.sensor.start();this.dispose=function(){var o=e.renderer.getSize(new THREE__namespace.Vector2);e.renderer.setScissor(0,0,o.width,o.height),e.renderer.setViewport(0,0,o.width,o.height),e.renderer.setScissorTest(!1),r()}}return n.prototype.render=function(t,e){var r=this.renderer.getSize(new THREE__namespace.Vector2);if(r.width>r.height){var o=t.autoUpdate;o&&(t.updateMatrixWorld(),t.autoUpdate=!1);var s={x:Math.round(r.width*defaultLeftBounds[0]),y:Math.round(r.height*defaultLeftBounds[1]),width:Math.round(r.width*defaultLeftBounds[2]),height:Math.round(r.height*defaultLeftBounds[3])},u={x:Math.round(r.width*defaultRightBounds[0]),y:Math.round(r.height*defaultRightBounds[1]),width:Math.round(r.width*defaultRightBounds[2]),height:Math.round(r.height*defaultRightBounds[3])};this.renderer.setScissorTest(!0),this.renderer.autoClear&&this.renderer.clear(),e.parent===null&&e.updateMatrixWorld(),e.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),e.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale);var l=this.sensor.getEyeOffset();this.cameraL.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.left),this.scale),this.cameraR.translateOnAxis(new THREE__namespace.Vector3().fromArray(l.right),this.scale);var c=this.sensor.getEyeProjectionMatrix();this.cameraL.projectionMatrix.elements=c.left.slice(),this.cameraR.projectionMatrix.elements=c.right.slice(),this.renderer.setViewport(s.x,s.y,s.width,s.height),this.renderer.setScissor(s.x,s.y,s.width,s.height),this.renderer.render(t,this.cameraL),this.renderer.setViewport(u.x,u.y,u.width,u.height),this.renderer.setScissor(u.x,u.y,u.width,u.height),this.renderer.render(t,this.cameraR),this.renderer.setViewport(0,0,r.width,r.height),this.renderer.setScissor(0,0,r.width,r.height),this.renderer.setScissorTest(!1),o&&(t.autoUpdate=!0)}else this.renderer.render(t,e)},n.prototype.dispose=function(){},n})();const cardboard="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADqCAMAAAAvZYhaAAAC/VBMVEUAAAD///99fX37+/v5+fn29vbx8fHv7+/Nzc3o6Ojq6urh4eHU1NTR0dGDg4Pl5eWSkpLHx8fj4+Pe3t7X19fAwMDZ2dnCwsKrq6uioqLb29uNjY2enp67u7t5eXmAgIC2traWlpa5ubnKysqmpqZycnKHh4eurq6ysrKKioqDg4Pd3d12dnb9/f1vb2/s7OxlZWXz8/OoqKiZmZlpaWmbm5teXl7W1tbJycnExMRiYmJsbGywsLCPj49aWlq9vb1UVFRYWFhra2t+fn7t7e1RUVFOTk6Dg4OAgICCgoKKioqEhISIiIhqamqCgoKIiIiQkJCIiIiWlpawsLBmZmaAgICenp6Li4uBgYGTk5OMjIyVlZWFhYWCgoKvr6+Ojo59fX2SkpKvr6+Ojo6QkJCurq6BgYGxsbF8fHx4eHitra2enp6srKyJiYmurq54eHj5+fl+fn57e3v////5+fnS0tLAwMCVlZWwsLCurq5QUFCtra2EhISUlJSwsLCUlJSUlJSlpaWVlZW3t7diYmLAwMCFhYV3d3f///+tra3///9XV1eampqnp6d8fHz///////9VVVVlZWVtbW3+/v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pF5u97hS1fOC26nlJJA8Yd41Sg3fU4dtRQkKeXSN3jo4Qqm0397OmyZOGatoDrScBIWM3DFn5kXi1ZyqRSUoZtKOa1vWKArztqgEnhIHty4f9/btuEstKwGkxf+XuCT5CbTFnFRuxktuAAAAAElFTkSuQmCC";var _a,LOCALE={zh:{TITLE:"眼镜模式",HIT:"请将手机横屏放入 VR 眼镜中"},en:{TITLE:"GLASSES MODE",HIT:"Please put the mobile phone horizontally into the VR glasses."},ja:{TITLE:"メガネモード",HIT:"携帯電話をVRメガネに水平に入れてください。"}},TEXT=typeof navigator!="undefined"&&(_a=LOCALE[navigator.language.split("-")[0]])!==null&&_a!==void 0?_a:LOCALE.zh,CONTENTS=`
|
|
1574
1574
|
<style>
|
|
1575
1575
|
.$id {
|
|
1576
1576
|
all: initial;
|
|
@@ -2130,7 +2130,7 @@ void main() {
|
|
|
2130
2130
|
#include <premultiplied_alpha_fragment>
|
|
2131
2131
|
|
|
2132
2132
|
}
|
|
2133
|
-
`},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,p=0,f=r.count;c<f;c++,p+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[p]=p===0?0:s[p-1],s[p+1]=s[p]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,p=c.resolution,f=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,m=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,g=new THREE__namespace.Vector4,y=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,E=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,g),g.w=1,g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(u),g.multiplyScalar(1/g.w),g.x*=p.x/2,g.y*=p.y/2,g.z=0,y.copy(g);var T=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,T);for(var _=0,S=d.count;_<S;_++){m.fromBufferAttribute(d,_),A.fromBufferAttribute(h,_),m.w=1,A.w=1,m.applyMatrix4(v),A.applyMatrix4(v),m.applyMatrix4(u),A.applyMatrix4(u),m.multiplyScalar(1/m.w),A.multiplyScalar(1/A.w);var R=m.z<-1&&A.z<-1,w=m.z>1&&A.z>1;if(!(R||w)){m.x*=p.x/2,m.y*=p.y/2,A.x*=p.x/2,A.y*=p.y/2,E.start.copy(m),E.start.z=0,E.end.copy(A),E.end.z=0;var M=E.closestPointToPointParameter(y,!0);E.at(M,b);var B=THREE__namespace.MathUtils.lerp(m.z,A.z,M),C=B>=-1&&B<=1,P=y.distanceTo(b)<f*.5;if(C&&P){E.start.fromBufferAttribute(d,_),E.end.fromBufferAttribute(h,_),E.start.applyMatrix4(T),E.end.applyMatrix4(T);var L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3;o.distanceSqToSegment(E.start,E.end,O,L),r.push({point:O,pointOnLine:L,distance:o.origin.distanceTo(O),object:this,faceIndex:_})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="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==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.1"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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"})};function fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,p,f,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(m){var A=u[m];return A&&(l={profileId:m,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(p=h.sent(),s){if(d=void 0,d=p.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(f=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:p,assetPath:f}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,p=o.valueNodeProperty;s&&(p===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:p===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(p){var f=p.valueNodeName,d=p.minNodeName,h=p.maxNodeName,m=p.valueNodeProperty;if(m===Constants.VisualResponseProperty.TRANSFORM){if(p.minNode=t.getObjectByName(d),p.maxNode=t.getObjectByName(h),!p.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!p.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}p.valueNode=t.getObjectByName(f),p.valueNode||console.warn("Could not find ".concat(f," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,p=l.assetPath;r.motionController=new MotionController(u,c,p);var f=e._assetCache[r.motionController.assetUrl];if(f)o=f.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,p){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(f){var d;return parseGltf(f.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(f){return p(f)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var p=r.xrManager.getControllerGrip(1);p.add(u.createControllerModel(p)),r.controllerWrappers[1].add(p)}),r.xrHandleState={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}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoIndex");getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(R,w){return mapPanoResource(applyImageURLOptions(R,d,w))},m=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality"])),A={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},g="pano:"+jsonHash([A,m,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var y=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(y))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),E=v.pano0,b=v.pano1,T;if((E==null?void 0:E.map.name)===g?T=E:(b==null?void 0:b.map.name)===g&&(T=b),T){var _={panoId:p,effect:c,leftPanoPicture:{panoId:T.panoId,map:T.map,mapSize:T.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,_,r);return}var S="move-to-pano-"+p;this.pending.add(S),this.pendingTextureTask={panoId:p,hash:g,onLoad:function(R){var w;s.pending.delete(S);var M=R.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,P={panoId:p,effect:c,leftPanoPicture:{panoId:p,map:M,mapSize:C,matrix:f.matrix.clone(),zoom:1},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,P,r)}},onError:function(R){s.pending.delete(S);var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:R,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&((M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(R)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:R,meta:null,pano:e}))},this.renderer).then(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g?(s.pendingTextureTask.onLoad(R),(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0),s.pendingTextureTask=void 0,s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:R.meta,pano:e}))):R.body.dispose()}).catch(function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&(s.pendingTextureTask.onError(R),(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0),s.pendingTextureTask=void 0,s.emit("pano.texture.error",createEvent("pano.texture.error",{error:R,progress:0,meta:null,pano:e})),s.emit("error",R))}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g;o===void 0&&(o={});var y=now(),v=createUuid();this.panoResources[v]=r;var E=1,b,T,_;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(y);S[0];var R=S[1],w=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position;b=Math.max(M.distanceTo(B),E),T=[{key:R.key,progress:0,value:__assign(__assign({},w),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],_=0}else{var C=this.locationMotion.getKeyFrameSegment(y),P=C[0],R=C[1],w=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(P).position,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position,O=R.value.count-w.count,F=Math.max(L.distanceTo(M),E)*O,N=Math.max(M.distanceTo(B),E);b=F+N,T=[{key:P.key,progress:0,value:__assign({},w)},{key:R.key,progress:F/b,value:R.value},{key:v,progress:1,value:{count:R.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(T);_=this.locationMotion.getProgressVelocity(y)*D/U}var z=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),K={longitude:o.longitude,latitude:o.latitude,fov:o.fov},j=__assign(__assign({},e),{mode:this.mode,longitude:(u=K.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=K.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=K.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),Q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:Q,progress:0,state:j,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(j),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(K,z).catch(noop);else{var V=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=coordinatesToVector({longitude:(p=K.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(f=K.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),W=new THREE__namespace.Object3D;W.lookAt(V);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Z=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion),Y=new THREE__namespace.Matrix4().getInverse(X).premultiply(Z),G=this.cameraMotion.value.fov,ee=(d=K.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,te=1;r.effect==="zoomin"?te=1.5:r.effect==="zoomout"&&(te=.4);for(var ne=ee*te,ae=0;ae<T.length-1;ae++){var ce=T[ae].key;if(ce){var ie=this.panoResources[ce];ie&&(ie.fixCameraTransform.copy(Y),ie.leftPanoPicture&&(ie.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(G/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(h=K.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(m=K.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=K.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(g=K.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ee}}],z).catch(noop)}var fe=this.locationMotion.setKeyframes(T,z,_);fe.then(function(){for(var ge=0,ye=s.modelScene.children;ge<ye.length;ge++){var _e=ye[ge];_e instanceof Model&&_e.show()}var le=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:Q,progress:1,state:le,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(le);var de=s.works.getObserver(s.currentPano);if(de&&de.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var re={map:s.videoTexture,size:de.video.size.clone(),matrix:de.video.matrix.clone(),panoMatrix:de.matrix.clone().premultiply(de.work.transform),alpha:1},se=createUuid(),he=s.videoTexture.image;he.setAttribute("uuid",se),canplayVideo().then(function(me){me&&de.video&&he.getAttribute("uuid")===se&&(he.oncanplay=function(){he.oncanplay=noop,he.play()},he.ontimeupdate=function(){he.currentTime>.5&&(he.ontimeupdate=noop,s.panoVideo.setMaterial(re))},he.src=de.video.source)}).catch((function(){he.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:Q,progress:0,state:j,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(_){if(_===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[_];if(!S)return!1;var R=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return R.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),p=this.modelScene.intersectRaycaster(e)[0];if(p){var f=arrayMin(c,function(_){var S=l[_];if(!S)return 1/0;var R=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return R.distanceTo(p.point)},!0),d=f[0],h=f[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var m=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);m&&(s=m)}for(var A=0,g=this.locationMotion.keyframes;A<g.length;A++){var y=g[A],v=this.panoResourceFromLocationMotionKeyframe(y);if(!(y.progress<this.locationMotion.progress)&&s){var E=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===E){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var E=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(E);b&&(b.setDisabled(!1),b.setLoading(!0))}var T={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:T,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:T,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,p,f,d,h,m,A=[],g=2;g<arguments.length;g++)A[g-2]=arguments[g];this.userAction=!0;var y={},v={},E=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],T=this.locationMotion.getKeyFrameSegment(e),_=T[0],S=T[1],R=this.panoResourceFromLocationMotionKeyframe(_),w=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(E),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),y.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var P=this.locationMotion.getKeyFrameSegment(e);P[0];var L=P[1],O=new THREE__namespace.Vector3().copy(R.position),F=new THREE__namespace.Vector3().copy(w.position),N=this.locationMotion.value.count-L.value.count+1;if(y.progress=N,w.leftPanoPicture&&(N<1?R.leftPanoPicture&&(y.pano0=R.leftPanoPicture):y.pano0=w.leftPanoPicture,y.pano1=w.leftPanoPicture),w.effect==="montage"?y.transition="BLACK":w.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(w.effect==="zoomin"||w.effect==="zoomout")&&(y.progress=Math.pow(N,3)),N<1&&w.effect!=="fly"){if(y.pano0&&R.leftPanoPicture){var D={panoId:y.pano0.panoId,map:y.pano0.map,mapSize:y.pano0.mapSize,zoom:y.pano0.zoom,matrix:R.leftPanoPicture.matrix.clone().setPosition(w.position)},U=this.panoPictureObserverMap.get(y.pano0);U&&this.panoPictureObserverMap.set(D,U),y.pano0=D}O.copy(F),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(O.x+(F.x-O.x)*N,O.y+(F.y-O.y)*N,O.z+(F.z-O.z)*N);for(var z=[],K=[],j=0,Q=this.locationMotion.keyframes;j<Q.length;j++){var V=Q[j],J=V.key,W=V.progress;J!==void 0&&(z.push(J),W>this.locationMotion.progress&&K.push(J))}for(var X=0,Z=Object.keys(this.panoResources);X<Z.length;X++){var Y=Z[X];if(!(K.indexOf(Y)>=0)){var G=this.panoResources[Y];if(G.leftPanoPicture){var ee=G.leftPanoPicture.map;if(ee){if(ee===((s=y.pano0)===null||s===void 0?void 0:s.map)||ee===((u=y.pano1)===null||u===void 0?void 0:u.map))continue;ee.dispose(),G.leftPanoPicture=null}}z.indexOf(Y)>=0||delete this.panoResources[Y]}}var te=panoParse(w.panoId);te!==this.currentPano&&(this.currentPano=te,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,ae=ne[1],ce=new THREE__namespace.Vector3(0,0,0),ie=new THREE__namespace.Vector2().copy(this.camera.resolution);if(ae&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var fe=this.xrManager.cameraVR,ge=this.xrManager.referenceSpace,ye=this.xrManager.session.renderState.baseLayer,_e=ae.getViewerPose(ge),le=(l=_e==null?void 0:_e.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(ye.framebuffer);for(var de=0;de<le.length;de++){var re=le[de],se=fe.cameras[de],he=ye.getViewport(re);he&&(se.projectionMatrix.fromArray(re.projectionMatrix),se.projectionMatrixInverse.getInverse(se.projectionMatrix),se.matrix.fromArray(re.transform.matrix),se.matrix.setPosition(this.camera.position),se.matrix.decompose(se.position,se.quaternion,se.scale),se.matrixWorld.copy(se.matrix),se.matrixWorldInverse.getInverse(se.matrixWorld),se.matrixAutoUpdate=!1,ce.copy(se.position),se.viewport.set(he.x,he.y,he.width,he.height),ie.set(he.width,he.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var de=0;de<this.xrManager.session.inputSources.length;de++)if(this.xrManager.session.inputSources[de]&&this.xrManager.session.inputSources[de].targetRayMode==="transient-pointer"){var me=ae.getPose(this.xrManager.session.inputSources[de].targetRaySpace,ge);if(me){var Ne=me.transform.orientation,qe=new THREE__namespace.Quaternion(Ne.x,Ne.y,Ne.z,Ne.w),Ye=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(qe),Ve=new THREE__namespace.Raycaster(this.camera.position,Ye);this.gazeRay=Ve}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ve=this.xrManager.session.inputSources,Ke=function(pe){var xe=Te.xrManager.controllers[pe],Se=ve[pe];if(!Se)return"continue";xe&&xe.update(Se,ae,ge);var Oe=Te.xrManager.getController(pe),Pt=new THREE__namespace.Vector3(0,1.2,0),st=Oe.position.clone().add(ce).sub(Pt);Se.handedness==="left"?Te.xrControllerRay.left.set(st,new THREE__namespace.Vector3(0,0,-1).applyEuler(Oe.rotation)):Se.handedness==="right"&&Te.xrControllerRay.right.set(st,new THREE__namespace.Vector3(0,0,-1).applyEuler(Oe.rotation)),Te.controllerWrappers[pe].position.copy(new THREE__namespace.Vector3(0,0,0).add(ce).sub(Pt));var Ze=Te.modelScene.intersectRaycaster(Te.xrControllerRay.right);if(Ze.length===0){var Ft=Te.works.getResolvedObserver(Te.currentPano);Ze=Te.xrControllerRay.right.intersectObject(Te.boundingMesh,!0).map(function(Xe){var Fe,lt=(Fe=Ft==null?void 0:Ft.floorIndex)!==null&&Fe!==void 0?Fe:0;return __assign({floorIndex:lt,floor:lt},Xe)})}if(Ze.length>=1&&Ze[0].face)if(Se.handedness==="right"){var I=Te.xrControllerRay.right.intersectObject(Te.xrCustomObjectsScene,!0),H=Ze[0].face.normal,k=H.clone(),q=Ze[0].point.clone();Te.intersectMesh.position.copy(q);var $=q.clone().add(k);if(Te.intersectMesh.lookAt($),Math.abs(H.y)>.99){var oe=Te.camera.position.clone().sub(q);Te.intersectMesh.rotation.z=-Math.atan2(oe.z,oe.x)}Te.intersectMesh.visible=!0,Te.needsRender=!0,I.length>0?(Te.pointerLines.right.setPoints(st,I[0].point),Te.pointerLines.right.points.visible=!0,Te.intersectMesh.visible=!1):(Te.pointerLines.right.points.visible=!1,Te.pointerLines.right.setPoints(st,Ze[0].point));var be=Ze[0],De=createEvent("intersect.update",{raycaster:(p=Te.xrControllerRay.right)!==null&&p!==void 0?p:null,intersection:be!=null?be:null,object:Te.intersectMesh});if(Te.emit("intersect.update",De),De.defaultPrevented)return Te.hideIntersectMesh(),{value:void 0}}else Te.pointerLines.left.setPoints(st,Ze[0].point)},Te=this,de=0;de<ve.length;de++){var Le=Ke(de);if(typeof Le=="object")return Le.value}this.updateControllerHelper(ve,e,r)}}else ae||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(y)===!1&&this.modelScene.parameter.set(y),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Me=this.works.getResolvedObserver(this.currentPano),$e=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,tt=this.works.getObserver(R.panoId),ke=this.works.getObserver(w.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Me){for(var Ie=[],He=Me.work.observers,Ee=0,we=Me.accessibleNodes;Ee<we.length;Ee++){var Pe=we[Ee],U=He[Pe];U&&Ie.push(U)}var je=new Map;if(Ie.sort(function(pe,xe){var Se=je.get(pe);typeof Se=="undefined"&&(Se=pe.standingPosition.distanceTo(Me.standingPosition),je.set(pe,Se));var Oe=je.get(pe);return typeof Oe=="undefined"&&(Oe=xe.standingPosition.distanceTo(Me.standingPosition),je.set(xe,Oe)),Se-Oe}),Ie.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%Ie.length;var Qe=Ie[this.accessibleObserverFloorCheckCount],We=this.modelScene.models.find(function(pe){return pe.work===(Qe==null?void 0:Qe.work)});if(Qe&&We&&We.visible){var gt=.3,Je=.05,At=.005,Re=Qe.standingPosition.clone().applyMatrix4(Qe.work.transform),Ue=panoStringify({panoIndex:Qe.panoIndex,workCode:Qe.work.workCode}),yt=adjustPanoCircleMeshVectors.map(function(pe){scratchRaycaster.ray.origin.copy(Re),scratchRaycaster.ray.origin.add(scratchVector3.copy(pe).setY(gt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var xe=We.intersectRaycaster(scratchRaycaster)[0];return xe&&xe.distance-At<=gt?new THREE__namespace.Vector3().copy(Re).setY(xe.point.y+At):Re});yt.sort(function(pe,xe){return xe.y-pe.y});var Ct=yt[Math.floor(yt.length/2)],Et=yt.filter(function(pe){return pe.distanceTo(Ct)<=Je})[0];if(Et){var dt=new THREE__namespace.Vector4(Re.x,Re.y,Re.z,Et.y-Re.y),ht=this.adjustPanoCircleMeshPositionFix.get(Ue);ht&&!dt.equals(ht)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(Ue,dt)}}this.accessibleObserverFloorCheckCount++}}var ze=new Map;if(tt)for(var ut=0,rt=tt.accessibleNodes;ut<rt.length;ut++){var Pe=rt[ut],U=tt.work.observers[Pe];if(U){var Ue=panoStringify({panoIndex:U.panoIndex,workCode:U.work.workCode});ze.set(Ue,U)}}if(ke)for(var ue=0,Ae=ke.accessibleNodes;ue<Ae.length;ue++){var Pe=Ae[ue],U=ke.work.observers[Pe];if(U){var Ue=panoStringify({panoIndex:U.panoIndex,workCode:U.work.workCode});ze.set(Ue,U)}}if(this.panoMeshes.forEach(function(pe,xe){var Se=ze.get(xe);if(Se){pe.position.copy(Se.standingPosition).applyMatrix4(Se.work.transform);var Oe=o.adjustPanoCircleMeshPositionFix.get(xe);Oe&&(scratchVector3.set(Oe.x,Oe.y,Oe.z),scratchVector3.equals(pe.position)&&(pe.position.y+=Oe.w)),pe.scale.setScalar(1.2),ze.delete(xe)}else o.helper.remove(pe),pe.dispose(),o.panoMeshes.delete(xe)}),ze.forEach(function(pe,xe){var Se=o.panoCircleMeshCreator(panoParse(xe));Se.position.copy(pe.standingPosition).applyMatrix4(pe.work.transform);var Oe=o.adjustPanoCircleMeshPositionFix.get(xe);Oe&&(scratchVector3.set(Oe.x,Oe.y,Oe.z),scratchVector3.equals(Se.position)&&(Se.position.y+=Oe.w)),Se.scale.setScalar(1.2),o.panoMeshes.set(xe,Se),o.helper.add(Se),ze.delete(xe)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(pe){pe.setOpacity(0),pe.setCurrent(!1),pe.updateTime&&pe.updateTime(e,r),pe.visible=!1});else if(Me){var Ce=Me.work.observers,Be=arrayMin(Me.accessibleNodes,function(pe){var xe=Ce[pe];return xe?Me.standingPosition.distanceTo(xe.standingPosition):1/0},!0),nt=Be[1];nt=clamp$1(nt,2.5,1/0);var ct=Me.visibleNodes.concat(Me.panoIndex).map(function(pe){return panoStringify({panoIndex:pe,workCode:Me.work.workCode})}),bt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(pe,xe){var Se=o.works.getObserver(xe);if(ct.indexOf(xe)===-1)pe.setCurrent(!1),pe.setOpacity(0);else if(!Se)pe.setCurrent(!1),pe.setOpacity(0);else if(!Se.loadable&&!Se.active)pe.setCurrent(!1),pe.setOpacity(0);else{var Oe=pe.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);pe.setCurrent(!pe.loading&&pe.progress===0&&$e!==null&&panoStringify({panoIndex:$e.panoIndex,workCode:$e.work.workCode})===xe),pe.setOpacity(Oe<.01?0:clamp$1(nt/Oe*1.2,.65,.98));var Pt=o.camera.position.clone().setY(pe.position.y),st=new THREE__namespace.Vector3().copy(pe.position).sub(Pt).normalize();if(xe===panoStringify(o.currentPano)){var Ze=clamp$1((.5-Pt.distanceTo(pe.position))/.5,0,1);st.multiplyScalar(1-Ze).add(bt.clone().multiplyScalar(Ze))}st.length()>0&&pe.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(st.x,st.z),0))}pe.updateTime&&pe.updateTime(e,r)})}{var N=(f=this.modelScene.parameter.progress)!==null&&f!==void 0?f:1,Bt=Math.round(N),at=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,Tt=Bt===0?at:pt,U=void 0;if(Tt&&(U=this.works.getObserver(Tt.panoId),U||(U=this.panoPictureObserverMap.get(Tt))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=N<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!U||!Tt||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Mt={renderer:this.renderer,resolution:ie,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Mt),this.modelScene.parameter.set("refinedScreen",null)}else{var it=getImageSizeLevel(Tt.mapSize),It=it+1,_t=4;this.tiling.setObserver(U);var Mt={renderer:this.renderer,resolution:ie,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:Tt.map,panoMatrix:Tt.matrix,panoZoom:Tt.zoom,minLevel:It,level:_t},vt=this.tiling.update(Mt),xt={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:Bt,opacity:(at==null?void 0:at.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},Ge=this.modelScene.parameter.refinedScreen;(vt||xt.pano!==(Ge==null?void 0:Ge.pano)||xt.opacity!==(Ge==null?void 0:Ge.opacity))&&this.modelScene.parameter.set("refinedScreen",xt)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&Me&&Me.position.y-Me.standingPosition.y>10){var mt=this.camera.position.distanceTo(this.intersectMesh.position),Ot=2*Math.tan(.5*this.camera.fov/180*Math.PI),Lt=mt*Ot/5;this.intersectMesh.scale.setScalar(Lt)}else this.intersectMesh.scale.setScalar(1);{var Ht=w.effect,ot=this.modelScene.parameter,at=ot.pano0,pt=ot.pano1;if(at&&pt&&at!==pt&&Ht==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==at.panoId||((m=this.modelScene.parameter.pano1Depth)===null||m===void 0?void 0:m.panoId)!==pt.panoId){var St=500,ft=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ft&&this.pano0DepthCubeRenderTarget.setSize(ft,ft):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ft&&this.pano1DepthCubeRenderTarget.setSize(ft,ft):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var Rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);Rt.matrix.copy(at.matrix),Rt.matrixWorld.copy(Rt.matrix),Rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Rt,St);var wt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);wt.matrix.copy(pt.matrix),wt.matrixWorld.copy(wt.matrix),wt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,wt,St),this.modelScene.parameter.set({pano0Depth:{panoId:at.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:St},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:St}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},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,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var p=e[c].handedness,f=e[c].gamepad;switch(p){case"left":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"LeftAxesDown",r)),f!=null&&f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"X",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"Y",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"LeftTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.buttons.X=f.buttons&&f.buttons[4]?f.buttons[4].pressed:!1,l.buttons.Y=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.LeftTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.LeftPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1,l.left=d;break;case"right":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"RightAxesDown",r)),f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"A",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"B",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"RightTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.right=h,l.buttons.A=f.buttons&&f.buttons[4]?f==null?void 0:f.buttons[4].pressed:!1,l.buttons.B=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.RightTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.RightPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),p=this.emit("xr.gesture.tap",c);!p&&!c.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function initLegacyEvent(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=coordinatesToVector(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),p=(t=c[0])===null||t===void 0?void 0:t.trim(),f=(e=c[1])===null||e===void 0?void 0:e.trim();p&&f&&(r[p]=f)}return r}function getViewportScale(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkS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eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3));geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2));geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5);camera$2.lookAt(0,0,0);camera$2.updateMatrixWorld(!0);camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,p=imageSize[0]/3,f=imageSize[1]/3;n.setViewport(l,c,p,f),n.setScissor(l,c,p,f),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
|
|
2133
|
+
`},LineMaterial=(function(n){__extends(t,n);function t(e){var r=n.call(this,{uniforms:THREE__namespace.UniformsUtils.clone(lineShader.uniforms),vertexShader:lineShader.vertexShader,fragmentShader:lineShader.fragmentShader,clipping:!0})||this;return r.type="LineMaterial",r.dashed=!1,Object.defineProperties(r,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(o){this.uniforms.diffuse.value=o}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(o){this.uniforms.linewidth.value=o}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(o){this.uniforms.dashScale.value=o}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(o){this.uniforms.dashSize.value=o}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(o){this.uniforms.gapSize.value=o}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(o){this.uniforms.opacity.value=o}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(o){this.uniforms.resolution.value.copy(o)}}}),r.setValues(e),r}return t})(THREE__namespace.ShaderMaterial);Object.assign(LineMaterial.prototype,{isLineMaterial:!0});var LineSegments2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this)||this;return o.type="LineSegments2",o.geometry=e!==void 0?e:new LineSegmentsGeometry,o.material=r!==void 0?r:new LineMaterial({color:Math.random()*16777215}),o}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,o=e.attributes.instanceEnd,s=new Float32Array(2*r.count),u=new THREE__namespace.Vector3,l=new THREE__namespace.Vector3,c=0,p=0,f=r.count;c<f;c++,p+=2)u.fromBufferAttribute(r,c),l.fromBufferAttribute(o,c),s[p]=p===0?0:s[p-1],s[p+1]=s[p]+u.distanceTo(l);var d=new THREE__namespace.InstancedInterleavedBuffer(s,2,1);return e.setAttribute("instanceDistanceStart",new THREE__namespace.InterleavedBufferAttribute(d,1,0)),e.setAttribute("instanceDistanceEnd",new THREE__namespace.InterleavedBufferAttribute(d,1,1)),this},t.prototype.raycast=function(e,r){e.camera===null&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var o=e.ray,s=e.camera,u=s.projectionMatrix,l=this.geometry,c=this.material,p=c.resolution,f=c.linewidth,d=l.attributes.instanceStart,h=l.attributes.instanceEnd,m=new THREE__namespace.Vector4,A=new THREE__namespace.Vector4,g=new THREE__namespace.Vector4,y=new THREE__namespace.Vector3,v=new THREE__namespace.Matrix4,E=new THREE__namespace.Line3,b=new THREE__namespace.Vector3;o.at(1,g),g.w=1,g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(u),g.multiplyScalar(1/g.w),g.x*=p.x/2,g.y*=p.y/2,g.z=0,y.copy(g);var T=this.matrixWorld;v.multiplyMatrices(s.matrixWorldInverse,T);for(var _=0,S=d.count;_<S;_++){m.fromBufferAttribute(d,_),A.fromBufferAttribute(h,_),m.w=1,A.w=1,m.applyMatrix4(v),A.applyMatrix4(v),m.applyMatrix4(u),A.applyMatrix4(u),m.multiplyScalar(1/m.w),A.multiplyScalar(1/A.w);var R=m.z<-1&&A.z<-1,w=m.z>1&&A.z>1;if(!(R||w)){m.x*=p.x/2,m.y*=p.y/2,A.x*=p.x/2,A.y*=p.y/2,E.start.copy(m),E.start.z=0,E.end.copy(A),E.end.z=0;var M=E.closestPointToPointParameter(y,!0);E.at(M,b);var B=THREE__namespace.MathUtils.lerp(m.z,A.z,M),C=B>=-1&&B<=1,P=y.distanceTo(b)<f*.5;if(C&&P){E.start.fromBufferAttribute(d,_),E.end.fromBufferAttribute(h,_),E.start.applyMatrix4(T),E.end.applyMatrix4(T);var L=new THREE__namespace.Vector3,O=new THREE__namespace.Vector3;o.distanceSqToSegment(E.start,E.end,O,L),r.push({point:O,pointOnLine:L,distance:o.origin.distanceTo(O),object:this,faceIndex:_})}}}},t})(THREE__namespace.Mesh);Object.assign(LineSegments2.prototype,{isLineSegments2:!0});var Line2=(function(n){__extends(t,n);function t(e,r){var o=n.call(this,e,r)||this;return o.type="Line2",o}return t})(LineSegments2);Object.assign(Line2.prototype,{isLine2:!0});var LineGeometry=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.type="LineGeometry",e}return t.prototype.setPositions=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setPositions.call(this,o),this},t.prototype.setColors=function(e){for(var r=e.length-3,o=new Float32Array(2*r),s=0;s<r;s+=3)o[2*s]=e[s],o[2*s+1]=e[s+1],o[2*s+2]=e[s+2],o[2*s+3]=e[s+3],o[2*s+4]=e[s+4],o[2*s+5]=e[s+5];return n.prototype.setColors.call(this,o),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof THREE__namespace.Geometry){var o=new THREE__namespace.BufferGeometry().fromGeometry(r);this.setPositions(o.attributes.position.array)}else r instanceof THREE__namespace.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t})(LineSegmentsGeometry);Object.assign(LineGeometry.prototype,{isLineGeometry:!0});var circleImageURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0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kwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",DEFAULT_COLOR=14467195,POINT_SIZE=8,DEFAULT_LINEWIDTH=2,DEFAULT_DASHSCALE=20,sharedCircleTexture=null,FiveLine=(function(n){__extends(t,n);function t(e,r){e===void 0&&(e=new THREE__namespace.Vector3),r===void 0&&(r=new THREE__namespace.Vector3);var o=n.call(this)||this;o.type="FiveLine",o.needsRender=!0;var s=new LineGeometry,u=new LineMaterial({color:DEFAULT_COLOR,linewidth:DEFAULT_LINEWIDTH,dashScale:DEFAULT_DASHSCALE,dashed:!1});o.line=new Line2(s,u);var l=new THREE__namespace.BufferGeometry,c=new THREE__namespace.PointsMaterial({color:DEFAULT_COLOR,size:POINT_SIZE,map:sharedCircleTexture||(sharedCircleTexture=new THREE__namespace.TextureLoader().load(circleImageURL)),sizeAttenuation:!1,transparent:!0});return o.points=new THREE__namespace.Points(l,c),o.points.renderOrder=11,o.points.frustumCulled=!1,o.setPoints(e,r),o.add(o.line,o.points),o}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.3"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var o=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new THREE__namespace.BufferAttribute(new Float32Array(o),3)),this.line.geometry.setPositions(o),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new THREE__namespace.Vector3(e[0],e[1],e[2]),new THREE__namespace.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o];o==="dashed"?(r.dashed=s,s?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[o]=e[o]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var o=this.line.material.resolution;(o.x!==e||o.y!==r)&&(o.set(e,r),this.needsRender=!0)},t})(THREE__namespace.Object3D);Object.assign(FiveLine.prototype,{isFiveLine:!0});var Constants={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"})};function fetchJsonFile(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return[4,fetch(n)];case 1:if(t=e.sent(),t.ok)return[2,t.json()];throw new Error(t.statusText)}})})}function fetchProfilesList(n){return __awaiter(this,void 0,void 0,function(){var t,e;return __generator(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,fetchJsonFile("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function fetchProfile(n,t){return __awaiter(this,arguments,void 0,function(e,r,o,s){var u,l,c,p,f,d;return o===void 0&&(o=null),s===void 0&&(s=!0),__generator(this,function(h){switch(h.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,fetchProfilesList(r)];case 1:if(u=h.sent(),e.profiles.some(function(m){var A=u[m];return A&&(l={profileId:m,profilePath:"".concat(r,"/").concat(A.path),deprecated:!!A.deprecated}),!!l}),!l){if(!o)throw new Error("No matching profile name found");if(c=u[o],!c)throw new Error('No matching profile name found and default profile "'.concat(o,'" missing.'));l={profileId:o,profilePath:"".concat(r,"/").concat(c.path),deprecated:!!c.deprecated}}return[4,fetchJsonFile(l.profilePath)];case 2:if(p=h.sent(),s){if(d=void 0,d=p.layouts[e.handedness],!d)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(l.profileId));d.assetPath&&(f=l.profilePath.replace("profile.json",d.assetPath))}return[2,{profile:p,assetPath:f}]}})})}var defaultComponentValues={xAxis:0,yAxis:0,button:0,state:Constants.ComponentState.DEFAULT};function normalizeAxes(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,o=Math.sqrt(n*n+t*t);if(o>1){var s=Math.atan2(t,n);e=Math.cos(s),r=Math.sin(s)}var u={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return u}var VisualResponse=(function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Constants.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(defaultComponentValues)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,o=t.button,s=t.state,u=normalizeAxes(e,r),l=u.normalizedXAxis,c=u.normalizedYAxis;switch(this.componentProperty){case Constants.ComponentProperty.X_AXIS:this.value=this.states.includes(s)?l:.5;break;case Constants.ComponentProperty.Y_AXIS:this.value=this.states.includes(s)?c:.5;break;case Constants.ComponentProperty.BUTTON:this.value=this.states.includes(s)?o:0;break;case Constants.ComponentProperty.STATE:this.valueNodeProperty===Constants.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(s):this.value=this.states.includes(s)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n})(),Component=(function(){function n(t,e){var r=this;if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(function(o){var s=new VisualResponse(e.visualResponses[o]);r.visualResponses[o]=s}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Constants.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}return Object.defineProperty(n.prototype,"data",{get:function(){var t=__assign({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Constants.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){var r=t.buttons[this.gamepadIndices.button];this.values.button=r.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,r.pressed||this.values.button===1?this.values.state=Constants.ComponentState.PRESSED:(r.touched||this.values.button>Constants.ButtonTouchThreshold)&&(this.values.state=Constants.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.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===Constants.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Constants.AxisTouchThreshold&&(this.values.state=Constants.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(o){o.updateFromComponent(e.values)})},n})(),MotionController=(function(){function n(t,e,r){var o=this;if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=r,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(function(s){var u=o.layoutDescription.components[s];o.components[s]=new Component(s,u)}),this.updateFromGamepad()}return Object.defineProperty(n.prototype,"gripSpace",{get:function(){return this.xrInputSource.gripSpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetRaySpace",{get:function(){return this.xrInputSource.targetRaySpace},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){var t=[];return Object.values(this.components).forEach(function(e){t.push(e.data)}),t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(){var t=this;Object.values(this.components).forEach(function(e){e.updateFromGamepad(t.xrInputSource.gamepad)})},n})(),DEFAULT_PROFILES_PATH="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",DEFAULT_PROFILE="generic-trigger",XRControllerModel=(function(n){__extends(t,n);function t(){var e=n.call(this)||this;return e.motionController=null,e.envMap=null,e}return t.prototype.setEnvironmentMap=function(e){var r=this;return this.envMap==e?this:(this.envMap=e,this.traverse(function(o){o instanceof THREE__namespace.Mesh&&o.isMesh&&(o.material.envMap=r.envMap,o.material.needsUpdate=!0)}),this)},t.prototype.updateMatrixWorld=function(e){n.prototype.updateMatrixWorld.call(this,e),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(function(r){Object.values(r.visualResponses).forEach(function(o){var s=o.valueNode,u=o.minNode,l=o.maxNode,c=o.value,p=o.valueNodeProperty;s&&(p===Constants.VisualResponseProperty.VISIBILITY?s.visible=c:p===Constants.VisualResponseProperty.TRANSFORM&&(s.quaternion.copy(u.quaternion).slerp(l.quaternion,c),s.position.lerpVectors(u.position,l.position,c)))})}))},t})(THREE.Object3D);function findNodes(n,t){Object.values(n.components).forEach(function(e){var r=e.type,o=e.touchPointNodeName,s=e.visualResponses;if(r===Constants.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(o),e.touchPointNode){var u=new THREE.SphereGeometry(.001),l=new THREE.MeshBasicMaterial({color:255}),c=new THREE.Mesh(u,l);e.touchPointNode.add(c)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(s).forEach(function(p){var f=p.valueNodeName,d=p.minNodeName,h=p.maxNodeName,m=p.valueNodeProperty;if(m===Constants.VisualResponseProperty.TRANSFORM){if(p.minNode=t.getObjectByName(d),p.maxNode=t.getObjectByName(h),!p.minNode){console.warn("Could not find ".concat(d," in the model"));return}if(!p.maxNode){console.warn("Could not find ".concat(h," in the model"));return}}p.valueNode=t.getObjectByName(f),p.valueNode||console.warn("Could not find ".concat(f," in the model"))})})}function addAssetSceneToControllerModel(n,t){findNodes(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof THREE__namespace.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var XRControllerModelFactory=(function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=DEFAULT_PROFILES_PATH,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new XRControllerModel,o=null;return t.addEventListener("connected",function(s){var u=s.data;u.targetRayMode!=="tracked-pointer"||!u.gamepad||fetchProfile(u,e.path,DEFAULT_PROFILE).then(function(l){var c=l.profile,p=l.assetPath;r.motionController=new MotionController(u,c,p);var f=e._assetCache[r.motionController.assetUrl];if(f)o=f.scene.clone(),addAssetSceneToControllerModel(r,o);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(d){e._assetCache[r.motionController.assetUrl]=d,o=d.scene.clone(),addAssetSceneToControllerModel(r,o)})}}).catch(function(l){console.warn(l)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(o),o=null}),r},n})(),defaultXRPanoramaControllerInitArgs=__assign({},omit(defaultPanoramaControllerCustomInitArgs,["maxLatitude","minLatitude"]));function mapPanoResource(n,t){return n}var CONTROLLER_EVNET_DELTA_TIME=300,scratchRaycaster=new THREE__namespace.Raycaster,scratchVector3=new THREE__namespace.Vector3,XRPanoramaController=(function(n){__extends(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new XRManager(r.renderer,r.renderer.getContext(),{onSessionStart:function(c){r.emit("xr.session.start",createEvent("xr.session.start",{session:c,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",createEvent("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new THREE__namespace.Raycaster,right:new THREE__namespace.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.left.firstHitOnly=!0,r.xrControllerRay.left.floorIndex=-1,r.xrControllerRay.right.params.Points={threshold:.1},r.xrControllerRay.right.firstHitOnly=!0,r.xrControllerRay.right.floorIndex=-1,r.gazeRay=null,r.pointerLines={left:new FiveLine,right:new FiveLine},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new THREE__namespace.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new THREE__namespace.Group,new THREE__namespace.Group];var o=r.xrManager.getController(0);r.controllerWrappers[0].add(o);var s=r.xrManager.getController(1);r.controllerWrappers[1].add(s);var u=new XRControllerModelFactory;u.gltfLoader={load:function(c,p){internalFetcher.ajax(c,{responseType:"arraybuffer"}).then(function(f){var d;return parseGltf(f.body,{resourcePath:c.slice(0,c.lastIndexOf("/")+1),search:(d=c.split("?")[1])!==null&&d!==void 0?d:"",fetcher:internalFetcher})}).then(function(f){return p(f)})}},(r.xrManager.machineType==="Oculus"||r.xrManager.machineType==="Pico")&&r.scene.add(r.pointerLines.left,r.pointerLines.right,r.controllerWrappers[0],r.controllerWrappers[1]),r.panoResources={},r.panoResources[r.locationMotion.keyframes[0].key=r.locationMotion.keyframes[1].key=createUuid()]={panoId:panoStringify(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new THREE__namespace.Matrix4},r.parallaxCameraMatrixs=[];var l=AnimationFrameLoop.shared.getContext();return l?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(l),r.on("xr.session.start",function(){var c=r.xrManager.getControllerGrip(0);c.add(u.createControllerModel(c)),r.controllerWrappers[0].add(c);var p=r.xrManager.getControllerGrip(1);p.add(u.createControllerModel(p)),r.controllerWrappers[1].add(p)}),r.xrHandleState={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}},r.xrManager.machineType==="VP"&&r.initHandEvent(),r):(console.error("获取session失败,请退出重试"),r)}return t.parseArgs=function(e){if(e instanceof t)return e;var r=__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),o=n.initAnimationEndState.call(this,r);return __assign(__assign({},o),{mode:"XRPanorama"})},t.prototype.updateConfiguration=function(e){return n.prototype.updateConfiguration.call(this,__assign(__assign({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2}))},t.prototype.moveToPano=function(e,r,o){var s=this,u,l,c=(u=r.effect)!==null&&u!==void 0?u:"fade";this.userAction=o,this.stopMomentumMovement();var p=panoStringify(e),f=this.works.getObserver(e);if(!f)throw new Error("Invalid PanoIndex");getImageSizeFromURL(f.images.up),this.imageOptions.size;var d=this.imageOptions.transform,h=function(R,w){return mapPanoResource(applyImageURLOptions(R,d,w))},m=__assign({key:"pano.".concat(p)},pick(this.imageOptions,["format","size","quality"])),A={right:f.images.work.getURL(f.images.right),left:f.images.work.getURL(f.images.left),up:f.images.work.getURL(f.images.up),down:f.images.work.getURL(f.images.down),front:f.images.work.getURL(f.images.front),back:f.images.work.getURL(f.images.back)},g="pano:"+jsonHash([A,m,d]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===g)return;var y=this.pendingTextureTask.panoId;(l=this.panoMeshes.get(y))===null||l===void 0||l.setProgress(0),this.emit("pano.texture.abort",createEvent("pano.texture.abort",{error:null,progress:0,meta:null,pano:e}))}var v=this.modelScene.parameter.resolveValue(),E=v.pano0,b=v.pano1,T;if((E==null?void 0:E.map.name)===g?T=E:(b==null?void 0:b.map.name)===g&&(T=b),T){var _={panoId:p,effect:c,leftPanoPicture:{panoId:T.panoId,map:T.map,mapSize:T.mapSize,matrix:f.matrix.clone().premultiply(f.work.transform),zoom:1},position:f.position.clone().applyMatrix4(f.work.transform),fixCameraTransform:new THREE__namespace.Matrix4};this.doMoveToPano(e,_,r);return}var S="move-to-pano-"+p;this.pending.add(S),this.pendingTextureTask={panoId:p,hash:g,onLoad:function(R){var w,M=R.body;if(s.destroyed)M.dispose();else{M.name=g;var B=Array.isArray(M.image)?M.image[0]:M.image,C=(w=B==null?void 0:B.width)!==null&&w!==void 0?w:2048,P={panoId:p,effect:c,leftPanoPicture:{panoId:p,map:M,mapSize:C,matrix:f.matrix.clone(),zoom:1},position:f.position.clone(),fixCameraTransform:new THREE__namespace.Matrix4};s.doMoveToPano(e,P,r)}},onError:function(R){var w=__assign(__assign(__assign({},e),{mode:s.mode}),clonePose(s.camera.pose));s.emit("pano.error",createEvent("pano.error",{error:R,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),s.emit("pano.cancel",createEvent("pano.cancel",{error:null,userAction:s.userAction,options:r,prevPano:s.currentPano,progress:0,state:w})),r.moveCancelCallback&&r.moveCancelCallback()}},this.textureLoader.loadCubeTexture(A,{imageURL:{transform:h,options:m},format:THREE__namespace.RGBAFormat,fetcher:getFetcher(f.work)},void 0,void 0,function(R){var w,M;((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&((M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(R)),s.emit("pano.texture.progress",createEvent("pano.texture.progress",{error:null,progress:R,meta:null,pano:e}))},this.renderer).then(function(R){var w,M;s.pending.delete(S),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g?(s.pendingTextureTask.onLoad(R),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)):R.body.dispose(),s.emit("pano.texture.success",createEvent("pano.texture.success",{error:null,progress:1,meta:R.meta,pano:e}))}).catch(function(R){var w,M;s.pending.delete(S),((w=s.pendingTextureTask)===null||w===void 0?void 0:w.hash)===g&&(s.pendingTextureTask.onError(R),s.pendingTextureTask=void 0,(M=s.panoMeshes.get(p))===null||M===void 0||M.setProgress(0)),s.emit("pano.texture.error",createEvent("pano.texture.error",{error:R,progress:0,meta:null,pano:e})),s.emit("error",R)}),this.emit("pano.texture.load",createEvent("pano.texture.load",{error:null,progress:0,meta:null,pano:e}))},t.prototype.doMoveToPano=function(e,r,o){var s=this,u,l,c,p,f,d,h,m,A,g;o===void 0&&(o={});var y=now(),v=createUuid();this.panoResources[v]=r;var E=1,b,T,_;if(this.locationMotion.ended){var S=this.locationMotion.getKeyFrameSegment(y);S[0];var R=S[1],w=this.locationMotion.value,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position;b=Math.max(M.distanceTo(B),E),T=[{key:R.key,progress:0,value:__assign(__assign({},w),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],_=0}else{var C=this.locationMotion.getKeyFrameSegment(y),P=C[0],R=C[1],w=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(P).position,M=this.panoResourceFromLocationMotionKeyframe(R).position,B=r.position,O=R.value.count-w.count,F=Math.max(L.distanceTo(M),E)*O,N=Math.max(M.distanceTo(B),E);b=F+N,T=[{key:P.key,progress:0,value:__assign({},w)},{key:R.key,progress:F/b,value:R.value},{key:v,progress:1,value:{count:R.value.count+1,distance:0}}];var D=this.locationMotionKeyframesLength(this.locationMotion.keyframes),U=this.locationMotionKeyframesLength(T);_=this.locationMotion.getProgressVelocity(y)*D/U}var z=r.effect==="instant"?0:this.calculateMovingDuration(o.duration,r.effect==="fly"?b:0),K={longitude:o.longitude,latitude:o.latitude,fov:o.fov},j=__assign(__assign({},e),{mode:this.mode,longitude:(u=K.longitude)!==null&&u!==void 0?u:this.camera.pose.longitude,latitude:(l=K.latitude)!==null&&l!==void 0?l:this.camera.pose.latitude,fov:(c=K.fov)!==null&&c!==void 0?c:this.camera.pose.fov,offset:r.position.clone(),distance:0}),Q=this.currentPano;if(this.emit("pano.moveTo",createEvent("pano.moveTo",{options:o,prevPano:Q,progress:0,state:j,userAction:this.userAction,error:null})),o.moveStartCallback&&o.moveStartCallback(j),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=noop,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(K,z).catch(noop);else{var V=coordinatesToVector({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),J=coordinatesToVector({longitude:(p=K.longitude)!==null&&p!==void 0?p:this.cameraMotion.value.longitude,latitude:(f=K.latitude)!==null&&f!==void 0?f:this.cameraMotion.value.latitude}),W=new THREE__namespace.Object3D;W.lookAt(V);var X=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion);W.lookAt(J);var Z=new THREE__namespace.Matrix4().makeRotationFromQuaternion(W.quaternion),Y=new THREE__namespace.Matrix4().getInverse(X).premultiply(Z),G=this.cameraMotion.value.fov,ee=(d=K.fov)!==null&&d!==void 0?d:this.cameraMotion.value.fov,te=1;r.effect==="zoomin"?te=1.5:r.effect==="zoomout"&&(te=.4);for(var ne=ee*te,ae=0;ae<T.length-1;ae++){var ce=T[ae].key;if(ce){var ie=this.panoResources[ce];ie&&(ie.fixCameraTransform.copy(Y),ie.leftPanoPicture&&(ie.leftPanoPicture.zoom=Math.tan(ne/2/180*Math.PI)/Math.tan(G/2/180*Math.PI)))}}this.cameraMotion.setKeyframes([{progress:0,value:{longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude,fov:this.cameraMotion.value.fov}},{progress:0,value:{longitude:(h=K.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(m=K.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(A=K.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(g=K.latitude)!==null&&g!==void 0?g:this.cameraMotion.value.latitude,fov:ee}}],z).catch(noop)}var fe=this.locationMotion.setKeyframes(T,z,_);fe.then(function(){for(var ge=0,ye=s.modelScene.children;ge<ye.length;ge++){var _e=ye[ge];_e instanceof Model&&_e.show()}var le=__assign(__assign({},e),{mode:s.mode,longitude:s.camera.pose.longitude,latitude:s.camera.pose.latitude,fov:s.camera.pose.fov,offset:s.camera.pose.offset.clone(),distance:0});s.emit("pano.arrived",createEvent("pano.arrived",{options:o,prevPano:Q,progress:1,state:le,userAction:s.userAction,error:null})),o.moveEndCallback&&o.moveEndCallback(le);var de=s.works.getObserver(s.currentPano);if(de&&de.video&&s.videoTexture&&s.videoTexture.image instanceof HTMLVideoElement){var re={map:s.videoTexture,size:de.video.size.clone(),matrix:de.video.matrix.clone(),panoMatrix:de.matrix.clone().premultiply(de.work.transform),alpha:1},se=createUuid(),he=s.videoTexture.image;he.setAttribute("uuid",se),canplayVideo().then(function(me){me&&de.video&&he.getAttribute("uuid")===se&&(he.oncanplay=function(){he.oncanplay=noop,he.play()},he.ontimeupdate=function(){he.currentTime>.5&&(he.ontimeupdate=noop,s.panoVideo.setMaterial(re))},he.src=de.video.source)}).catch((function(){he.removeAttribute("uuid")}))}},function(){s.emit("pano.cancel",createEvent("pano.cancel",{options:o,prevPano:Q,progress:0,state:j,userAction:s.userAction,error:null})),o.moveCancelCallback&&o.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,o;this.stopMomentumMovement(),this.camera.getDirection(new THREE__namespace.Vector3).setY(0);var s=null,u=this.works.getObserver(this.currentPano);if(!u)return null;var l=u.work.observers,c=u.accessibleNodes.filter(function(_){if(_===r.currentPano.panoIndex&&u.work.workCode===r.currentPano.workCode)return!1;var S=l[_];if(!S)return!1;var R=scratchVector3.copy(S.position).applyMatrix4(S.work.transform);return R.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:S.loadable||S.active}),p=this.modelScene.intersectRaycaster(e)[0];if(p){var f=arrayMin(c,function(_){var S=l[_];if(!S)return 1/0;var R=scratchVector3.copy(S.standingPosition).applyMatrix4(S.work.transform);return R.distanceTo(p.point)},!0),d=f[0],h=f[1];typeof d=="number"&&h<this.panoTapTriggerRadius&&(s=(o=l[d])!==null&&o!==void 0?o:null)}if(isNil(s)){var m=this.getForwardObserverOrNot(this.xrManager.cameraVR,e);m&&(s=m)}for(var A=0,g=this.locationMotion.keyframes;A<g.length;A++){var y=g[A],v=this.panoResourceFromLocationMotionKeyframe(y);if(!(y.progress<this.locationMotion.progress)&&s){var E=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode});if(v.panoId===E){s=null;break}}}if(isNil(s))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(!s.active){var E=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),b=this.panoMeshes.get(E);b&&(b.setDisabled(!1),b.setLoading(!0))}var T={workCode:s.work.workCode,panoIndex:s.panoIndex,mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:0,offset:s?s.position.clone():new THREE__namespace.Vector3};return this.emit("pano.select",createEvent("pano.select",{prevPano:this.currentPano,state:T,userAction:!0,options:{},progress:0,error:null})),s&&s.active?(this.emit("pano.request",createEvent("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:T,options:{},error:null})),{workCode:s.work.workCode,panoIndex:s.panoIndex}):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,o){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,o){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var o=this,s,u,l,c,p,f,d,h,m,A=[],g=2;g<arguments.length;g++)A[g-2]=arguments[g];this.userAction=!0;var y={},v={},E=this.locationMotion.keyframes[0],b=this.locationMotion.keyframes[this.locationMotion.keyframes.length-1],T=this.locationMotion.getKeyFrameSegment(e),_=T[0],S=T[1],R=this.panoResourceFromLocationMotionKeyframe(_),w=this.panoResourceFromLocationMotionKeyframe(S),M=this.panoResourceFromLocationMotionKeyframe(E),B=this.panoResourceFromLocationMotionKeyframe(b),C=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),v.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),y.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(clamp$1(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var P=this.locationMotion.getKeyFrameSegment(e);P[0];var L=P[1],O=new THREE__namespace.Vector3().copy(R.position),F=new THREE__namespace.Vector3().copy(w.position),N=this.locationMotion.value.count-L.value.count+1;if(y.progress=N,w.leftPanoPicture&&(N<1?R.leftPanoPicture&&(y.pano0=R.leftPanoPicture):y.pano0=w.leftPanoPicture,y.pano1=w.leftPanoPicture),w.effect==="montage"?y.transition="BLACK":w.effect==="spread"?y.transition="SPREAD":y.transition="FADE",(w.effect==="zoomin"||w.effect==="zoomout")&&(y.progress=Math.pow(N,3)),N<1&&w.effect!=="fly"){if(y.pano0&&R.leftPanoPicture){var D={panoId:y.pano0.panoId,map:y.pano0.map,mapSize:y.pano0.mapSize,zoom:y.pano0.zoom,matrix:R.leftPanoPicture.matrix.clone().setPosition(w.position)},U=this.panoPictureObserverMap.get(y.pano0);U&&this.panoPictureObserverMap.set(D,U),y.pano0=D}O.copy(F),C=!0}v.distance=this.locationMotion.value.distance,v.offset=new THREE__namespace.Vector3(O.x+(F.x-O.x)*N,O.y+(F.y-O.y)*N,O.z+(F.z-O.z)*N);for(var z=[],K=[],j=0,Q=this.locationMotion.keyframes;j<Q.length;j++){var V=Q[j],J=V.key,W=V.progress;J!==void 0&&(z.push(J),W>this.locationMotion.progress&&K.push(J))}for(var X=0,Z=Object.keys(this.panoResources);X<Z.length;X++){var Y=Z[X];if(!(K.indexOf(Y)>=0)){var G=this.panoResources[Y];if(G.leftPanoPicture){var ee=G.leftPanoPicture.map;if(ee){if(ee===((s=y.pano0)===null||s===void 0?void 0:s.map)||ee===((u=y.pano1)===null||u===void 0?void 0:u.map))continue;ee.dispose(),G.leftPanoPicture=null}}z.indexOf(Y)>=0||delete this.panoResources[Y]}}var te=panoParse(w.panoId);te!==this.currentPano&&(this.currentPano=te,this.accessibleObserverFloorCheckCount=0),this.emit("pano.moving",createEvent("pano.moving",{userAction:this.userAction,prevPano:panoParse(M.panoId),state:__assign(__assign(__assign(__assign({},panoParse(B.panoId)),{mode:this.mode}),clonePose(this.camera.pose)),v),options:{},progress:this.locationMotion.progress,error:null}))}this.camera.setFromPose(v),this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix),this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.xrManager.cameraVR.matrix.copy(this.camera.matrix),this.xrManager.cameraVR.position.copy(this.camera.position),this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion),this.xrManager.cameraVR.scale.copy(this.camera.scale),this.xrManager.cameraVR.matrixAutoUpdate=!1,this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);var ne=A,ae=ne[1],ce=new THREE__namespace.Vector3(0,0,0),ie=new THREE__namespace.Vector2().copy(this.camera.resolution);if(ae&&this.xrManager.session&&this.xrManager.referenceSpace&&this.xrManager.session.renderState.baseLayer){var fe=this.xrManager.cameraVR,ge=this.xrManager.referenceSpace,ye=this.xrManager.session.renderState.baseLayer,_e=ae.getViewerPose(ge),le=(l=_e==null?void 0:_e.views)!==null&&l!==void 0?l:[];this.renderer.setFramebuffer(ye.framebuffer);for(var de=0;de<le.length;de++){var re=le[de],se=fe.cameras[de],he=ye.getViewport(re);he&&(se.projectionMatrix.fromArray(re.projectionMatrix),se.projectionMatrixInverse.getInverse(se.projectionMatrix),se.matrix.fromArray(re.transform.matrix),se.matrix.setPosition(this.camera.position),se.matrix.decompose(se.position,se.quaternion,se.scale),se.matrixWorld.copy(se.matrix),se.matrixWorldInverse.getInverse(se.matrixWorld),se.matrixAutoUpdate=!1,ce.copy(se.position),se.viewport.set(he.x,he.y,he.width,he.height),ie.set(he.width,he.height))}if(this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR,this.xrManager.cameraL,this.xrManager.cameraR),this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion),this.camera.scale.copy(this.xrManager.cameraVR.scale),this.camera.matrix.compose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.computePose((c=v.distance)!==null&&c!==void 0?c:this.camera.pose.distance),this.xrManager.session&&this.xrManager.session.inputSources){for(var de=0;de<this.xrManager.session.inputSources.length;de++)if(this.xrManager.session.inputSources[de]&&this.xrManager.session.inputSources[de].targetRayMode==="transient-pointer"){var me=ae.getPose(this.xrManager.session.inputSources[de].targetRaySpace,ge);if(me){var Ne=me.transform.orientation,qe=new THREE__namespace.Quaternion(Ne.x,Ne.y,Ne.z,Ne.w),Ye=new THREE__namespace.Vector3(0,0,-1).applyQuaternion(qe),Ve=new THREE__namespace.Raycaster(this.camera.position,Ye);this.gazeRay=Ve}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var ve=this.xrManager.session.inputSources,Ke=function(pe){var xe=Te.xrManager.controllers[pe],Se=ve[pe];if(!Se)return"continue";xe&&xe.update(Se,ae,ge);var Oe=Te.xrManager.getController(pe),Pt=new THREE__namespace.Vector3(0,1.2,0),st=Oe.position.clone().add(ce).sub(Pt);Se.handedness==="left"?Te.xrControllerRay.left.set(st,new THREE__namespace.Vector3(0,0,-1).applyEuler(Oe.rotation)):Se.handedness==="right"&&Te.xrControllerRay.right.set(st,new THREE__namespace.Vector3(0,0,-1).applyEuler(Oe.rotation)),Te.controllerWrappers[pe].position.copy(new THREE__namespace.Vector3(0,0,0).add(ce).sub(Pt));var Ze=Te.modelScene.intersectRaycaster(Te.xrControllerRay.right);if(Ze.length===0){var Ft=Te.works.getResolvedObserver(Te.currentPano);Ze=Te.xrControllerRay.right.intersectObject(Te.boundingMesh,!0).map(function(Xe){var Fe,lt=(Fe=Ft==null?void 0:Ft.floorIndex)!==null&&Fe!==void 0?Fe:0;return __assign({floorIndex:lt,floor:lt},Xe)})}if(Ze.length>=1&&Ze[0].face)if(Se.handedness==="right"){var I=Te.xrControllerRay.right.intersectObject(Te.xrCustomObjectsScene,!0),H=Ze[0].face.normal,k=H.clone(),q=Ze[0].point.clone();Te.intersectMesh.position.copy(q);var $=q.clone().add(k);if(Te.intersectMesh.lookAt($),Math.abs(H.y)>.99){var oe=Te.camera.position.clone().sub(q);Te.intersectMesh.rotation.z=-Math.atan2(oe.z,oe.x)}Te.intersectMesh.visible=!0,Te.needsRender=!0,I.length>0?(Te.pointerLines.right.setPoints(st,I[0].point),Te.pointerLines.right.points.visible=!0,Te.intersectMesh.visible=!1):(Te.pointerLines.right.points.visible=!1,Te.pointerLines.right.setPoints(st,Ze[0].point));var be=Ze[0],De=createEvent("intersect.update",{raycaster:(p=Te.xrControllerRay.right)!==null&&p!==void 0?p:null,intersection:be!=null?be:null,object:Te.intersectMesh});if(Te.emit("intersect.update",De),De.defaultPrevented)return Te.hideIntersectMesh(),{value:void 0}}else Te.pointerLines.left.setPoints(st,Ze[0].point)},Te=this,de=0;de<ve.length;de++){var Le=Ke(de);if(typeof Le=="object")return Le.value}this.updateControllerHelper(ve,e,r)}}else ae||console.error("xrFrame丢失,请重试"),this.xrManager.session||console.error("session丢失,请重试"),this.xrManager.session&&!this.xrManager.session.renderState.baseLayer&&console.error("no layer found");isEmptyObject(y)===!1&&this.modelScene.parameter.set(y),this.emit("camera.update",createEvent("camera.update",{userAction:this.userAction,state:__assign(__assign(__assign({},this.currentPano),{mode:this.mode}),clonePose(this.camera.pose))}));var Me=this.works.getResolvedObserver(this.currentPano),$e=this.locationMotion.ended?this.getForwardObserverOrNot(this.xrManager.cameraVR):null,tt=this.works.getObserver(R.panoId),ke=this.works.getObserver(w.panoId);if(this.adjustPanoCircleMeshPositionBasedOnModel&&this.helper.visible&&Me){for(var Ie=[],He=Me.work.observers,Ee=0,we=Me.accessibleNodes;Ee<we.length;Ee++){var Pe=we[Ee],U=He[Pe];U&&Ie.push(U)}var je=new Map;if(Ie.sort(function(pe,xe){var Se=je.get(pe);typeof Se=="undefined"&&(Se=pe.standingPosition.distanceTo(Me.standingPosition),je.set(pe,Se));var Oe=je.get(pe);return typeof Oe=="undefined"&&(Oe=xe.standingPosition.distanceTo(Me.standingPosition),je.set(xe,Oe)),Se-Oe}),Ie.length){this.accessibleObserverFloorCheckCount=this.accessibleObserverFloorCheckCount%Ie.length;var Qe=Ie[this.accessibleObserverFloorCheckCount],We=this.modelScene.models.find(function(pe){return pe.work===(Qe==null?void 0:Qe.work)});if(Qe&&We&&We.visible){var gt=.3,Je=.05,At=.005,Re=Qe.standingPosition.clone().applyMatrix4(Qe.work.transform),Ue=panoStringify({panoIndex:Qe.panoIndex,workCode:Qe.work.workCode}),yt=adjustPanoCircleMeshVectors.map(function(pe){scratchRaycaster.ray.origin.copy(Re),scratchRaycaster.ray.origin.add(scratchVector3.copy(pe).setY(gt)),scratchRaycaster.ray.direction.set(0,-1,0),scratchRaycaster.firstHitOnly=!0,scratchRaycaster.floorIndex=-1;var xe=We.intersectRaycaster(scratchRaycaster)[0];return xe&&xe.distance-At<=gt?new THREE__namespace.Vector3().copy(Re).setY(xe.point.y+At):Re});yt.sort(function(pe,xe){return xe.y-pe.y});var Ct=yt[Math.floor(yt.length/2)],Et=yt.filter(function(pe){return pe.distanceTo(Ct)<=Je})[0];if(Et){var dt=new THREE__namespace.Vector4(Re.x,Re.y,Re.z,Et.y-Re.y),ht=this.adjustPanoCircleMeshPositionFix.get(Ue);ht&&!dt.equals(ht)&&(this.needsRender=!0),this.adjustPanoCircleMeshPositionFix.set(Ue,dt)}}this.accessibleObserverFloorCheckCount++}}var ze=new Map;if(tt)for(var ut=0,rt=tt.accessibleNodes;ut<rt.length;ut++){var Pe=rt[ut],U=tt.work.observers[Pe];if(U){var Ue=panoStringify({panoIndex:U.panoIndex,workCode:U.work.workCode});ze.set(Ue,U)}}if(ke)for(var ue=0,Ae=ke.accessibleNodes;ue<Ae.length;ue++){var Pe=Ae[ue],U=ke.work.observers[Pe];if(U){var Ue=panoStringify({panoIndex:U.panoIndex,workCode:U.work.workCode});ze.set(Ue,U)}}if(this.panoMeshes.forEach(function(pe,xe){var Se=ze.get(xe);if(Se){pe.position.copy(Se.standingPosition).applyMatrix4(Se.work.transform);var Oe=o.adjustPanoCircleMeshPositionFix.get(xe);Oe&&(scratchVector3.set(Oe.x,Oe.y,Oe.z),scratchVector3.equals(pe.position)&&(pe.position.y+=Oe.w)),pe.scale.setScalar(1.2),ze.delete(xe)}else o.helper.remove(pe),pe.dispose(),o.panoMeshes.delete(xe)}),ze.forEach(function(pe,xe){var Se=o.panoCircleMeshCreator(panoParse(xe));Se.position.copy(pe.standingPosition).applyMatrix4(pe.work.transform);var Oe=o.adjustPanoCircleMeshPositionFix.get(xe);Oe&&(scratchVector3.set(Oe.x,Oe.y,Oe.z),scratchVector3.equals(Se.position)&&(Se.position.y+=Oe.w)),Se.scale.setScalar(1.2),o.panoMeshes.set(xe,Se),o.helper.add(Se),ze.delete(xe)}),this.camera.pose.distance>.1||C)this.panoMeshes.forEach(function(pe){pe.setOpacity(0),pe.setCurrent(!1),pe.updateTime&&pe.updateTime(e,r),pe.visible=!1});else if(Me){var Ce=Me.work.observers,Be=arrayMin(Me.accessibleNodes,function(pe){var xe=Ce[pe];return xe?Me.standingPosition.distanceTo(xe.standingPosition):1/0},!0),nt=Be[1];nt=clamp$1(nt,2.5,1/0);var ct=Me.visibleNodes.concat(Me.panoIndex).map(function(pe){return panoStringify({panoIndex:pe,workCode:Me.work.workCode})}),bt=this.camera.getDirection(new THREE__namespace.Vector3);this.panoMeshes.forEach(function(pe,xe){var Se=o.works.getObserver(xe);if(ct.indexOf(xe)===-1)pe.setCurrent(!1),pe.setOpacity(0);else if(!Se)pe.setCurrent(!1),pe.setOpacity(0);else if(!Se.loadable&&!Se.active)pe.setCurrent(!1),pe.setOpacity(0);else{var Oe=pe.position.clone().setY(o.camera.position.y).distanceTo(o.camera.position);pe.setCurrent(!pe.loading&&pe.progress===0&&$e!==null&&panoStringify({panoIndex:$e.panoIndex,workCode:$e.work.workCode})===xe),pe.setOpacity(Oe<.01?0:clamp$1(nt/Oe*1.2,.65,.98));var Pt=o.camera.position.clone().setY(pe.position.y),st=new THREE__namespace.Vector3().copy(pe.position).sub(Pt).normalize();if(xe===panoStringify(o.currentPano)){var Ze=clamp$1((.5-Pt.distanceTo(pe.position))/.5,0,1);st.multiplyScalar(1-Ze).add(bt.clone().multiplyScalar(Ze))}st.length()>0&&pe.quaternion.setFromEuler(new THREE__namespace.Euler(0,Math.atan2(st.x,st.z),0))}pe.updateTime&&pe.updateTime(e,r)})}{var N=(f=this.modelScene.parameter.progress)!==null&&f!==void 0?f:1,Bt=Math.round(N),at=this.modelScene.parameter.pano0,pt=this.modelScene.parameter.pano1,Tt=Bt===0?at:pt,U=void 0;if(Tt&&(U=this.works.getObserver(Tt.panoId),U||(U=this.panoPictureObserverMap.get(Tt))),this.tiling.appearDuration=this.tileAppearDuration,this.tiling.maxRequest=N<.6?0:this.tileMaxRequest,this.tiling.imageOptions=this.imageOptions,!U||!Tt||this.tileLevelForFov===!1||this.camera.perspToOrtho.x>0){this.tiling.setObserver(null);var Mt={renderer:this.renderer,resolution:ie,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:null,panoMatrix:new THREE__namespace.Matrix4,panoZoom:1,minLevel:0,level:0};this.tiling.update(Mt),this.modelScene.parameter.set("refinedScreen",null)}else{var it=getImageSizeLevel(Tt.mapSize),It=it+1,_t=4;this.tiling.setObserver(U);var Mt={renderer:this.renderer,resolution:ie,pixelRatio:1,time:this.camera.time,cameraMatrix:this.xrManager.cameraVR.matrixWorld,cameraProjectionMatrix:this.xrManager.cameraVR.projectionMatrix,panoMap:Tt.map,panoMatrix:Tt.matrix,panoZoom:Tt.zoom,minLevel:It,level:_t},vt=this.tiling.update(Mt),xt={map:this.tiling.renderTarget.texture,matrixInverse:this.tiling.camera.matrixWorldInverse,projectionMatrix:this.tiling.camera.projectionMatrix,pano:Bt,opacity:(at==null?void 0:at.panoId)===(pt==null?void 0:pt.panoId)?1:easeInQuart(Math.abs(((d=this.modelScene.parameter.progress)!==null&&d!==void 0?d:0)-.5)*2)},Ge=this.modelScene.parameter.refinedScreen;(vt||xt.pano!==(Ge==null?void 0:Ge.pano)||xt.opacity!==(Ge==null?void 0:Ge.opacity))&&this.modelScene.parameter.set("refinedScreen",xt)}}if(this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e),this.intersectMesh&&this.intersectMesh.parent&&Me&&Me.position.y-Me.standingPosition.y>10){var mt=this.camera.position.distanceTo(this.intersectMesh.position),Ot=2*Math.tan(.5*this.camera.fov/180*Math.PI),Lt=mt*Ot/5;this.intersectMesh.scale.setScalar(Lt)}else this.intersectMesh.scale.setScalar(1);{var Ht=w.effect,ot=this.modelScene.parameter,at=ot.pano0,pt=ot.pano1;if(at&&pt&&at!==pt&&Ht==="fly"&&this.flyEffectUseDepthBuffer){if(((h=this.modelScene.parameter.pano0Depth)===null||h===void 0?void 0:h.panoId)!==at.panoId||((m=this.modelScene.parameter.pano1Depth)===null||m===void 0?void 0:m.panoId)!==pt.panoId){var St=500,ft=512;this.pano0DepthCubeRenderTarget?this.pano0DepthCubeRenderTarget.width!==ft&&this.pano0DepthCubeRenderTarget.setSize(ft,ft):this.pano0DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1}),this.pano1DepthCubeRenderTarget?this.pano1DepthCubeRenderTarget.width!==ft&&this.pano1DepthCubeRenderTarget.setSize(ft,ft):this.pano1DepthCubeRenderTarget=new THREE__namespace.WebGLCubeRenderTarget(ft,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,generateMipmaps:!1});var Rt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano0DepthCubeRenderTarget);Rt.matrix.copy(at.matrix),Rt.matrixWorld.copy(Rt.matrix),Rt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,Rt,St);var wt=new THREE__namespace.CubeCamera(this.camera.near,this.camera.far,this.pano1DepthCubeRenderTarget);wt.matrix.copy(pt.matrix),wt.matrixWorld.copy(wt.matrix),wt.matrixAutoUpdate=!1,renderDepthCube(this.renderer,this.modelScene,wt,St),this.modelScene.parameter.set({pano0Depth:{panoId:at.panoId,map:this.pano0DepthCubeRenderTarget.texture,mapSize:this.pano0DepthCubeRenderTarget.width,maxDepth:St},pano1Depth:{panoId:pt.panoId,map:this.pano1DepthCubeRenderTarget.texture,mapSize:this.pano1DepthCubeRenderTarget.width,maxDepth:St}})}}else this.modelScene.parameter.set({pano0Depth:null,pano1Depth:null}),this.flyEffectUseDepthBuffer||(this.pano0DepthCubeRenderTarget&&(this.pano0DepthCubeRenderTarget.dispose(),this.pano0DepthCubeRenderTarget=void 0),this.pano1DepthCubeRenderTarget&&(this.pano1DepthCubeRenderTarget.dispose(),this.pano1DepthCubeRenderTarget=void 0))}},t.prototype.render=function(){this.renderer.setScissorTest(!1);var e=this.xrManager.cameraVR;this.renderer.render(this.modelScene,e),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,e),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},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,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var l={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},c=0;c<e.length;c++){var p=e[c].handedness,f=e[c].gamepad;switch(p){case"left":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"LeftAxesDown",r)),f!=null&&f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"X",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"Y",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"LeftTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"LeftPinch",r));var d={raycaster:s,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.buttons.X=f.buttons&&f.buttons[4]?f.buttons[4].pressed:!1,l.buttons.Y=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.LeftTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.LeftPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1,l.left=d;break;case"right":f.axes&&(this.emitHandleEvent(f.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(f.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(f.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(f.axes[3]===1,"RightAxesDown",r)),f.buttons&&(f.buttons[4]&&this.emitHandleEvent(f.buttons[4].pressed,"A",r),f.buttons[5]&&this.emitHandleEvent(f.buttons[5].pressed,"B",r),f.buttons[0]&&this.emitHandleEvent(f.buttons[0].pressed,"RightTrigger",r),f.buttons[1]&&this.emitHandleEvent(f.buttons[1].pressed,"RightPinch",r));var h={raycaster:u,axes:{up:f.axes&&f.axes[3]<0?Math.abs(f.axes[3]):0,down:f.axes&&f.axes[3]<0?0:Math.abs(f.axes[3]),left:f.axes&&f.axes[2]<0?Math.abs(f.axes[2]):0,right:f.axes&&f.axes[2]<0?0:Math.abs(f.axes[2])},deltaTime:o};l.right=h,l.buttons.A=f.buttons&&f.buttons[4]?f==null?void 0:f.buttons[4].pressed:!1,l.buttons.B=f.buttons&&f.buttons[5]?f==null?void 0:f.buttons[5].pressed:!1,l.buttons.RightTrigger=f.buttons&&f.buttons[0]?f==null?void 0:f.buttons[0].pressed:!1,l.buttons.RightPinch=f.buttons&&f.buttons[1]?f==null?void 0:f.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",createEvent("xr.controller.update",l))}},t.prototype.emitHandleEvent=function(e,r,o){var s=this.xrControllerRay.left,u=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=o,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",createEvent("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}));else{var l=o-this.xrHandleState[r].touchStartTime;l>CONTROLLER_EVNET_DELTA_TIME&&this.emit("xr.gesture.press",createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:s,rightRay:u}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",createEvent("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}));var l=o-this.xrHandleState[r].touchStartTime;if(l<=CONTROLLER_EVNET_DELTA_TIME){var c=createEvent("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:s,rightRay:u}}}),p=this.emit("xr.gesture.tap",c);!p&&!c.defaultPrevented&&r==="RightTrigger"&&this.checkSelectedPano(this.xrControllerRay.right)}this.xrHandleState[r].touchStart=!1,this.xrHandleState[r].touchStartTime=0}},t.prototype.initHandEvent=function(){var e=this;if(!this.xrManager.session)throw new Error("初始化失败");this.xrManager.session.addEventListener("select",function(r){e.gazeRay&&e.checkSelectedPano(e.gazeRay)})},t})(PanoramaController),Controllers={Floorplan:FloorplanController,Topview:TopviewController,Panorama:PanoramaController,VRPanorama:VRPanoramaController,Model:ModelController,Mapview:MapviewController,XRPanorama:XRPanoramaController},controllersDefaultInitArgs={Floorplan:defaultFloorplanControllerCustomInitArgs,Topview:defaultTopviewControllerCustomInitArgs,Panorama:defaultPanoramaControllerCustomInitArgs,VRPanorama:defaultVRPanoramaControllerCustomInitArgs,Model:defaultModelControllerCustomInitArgs,Mapview:defaultMapviewControllerCustomInitArgs,XRPanorama:defaultXRPanoramaControllerInitArgs},PROXY_CONTROLLER_EVENT_NAMES=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function initLegacyEvent(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=coordinatesToVector(t.state);e.setLength(t.state.distance);var r=t.state.offset.clone().sub(e);n.emit("cameraPositionUpdate",r,t.userAction),n.emit("cameraUpdate",t.state,t.userAction)}),n.on("intersect.update",function(t){if(t.intersection){var e=!1;e=n.emit("wantsShowIntersectionOnModel",t.raycaster),e&&t.preventDefault(),t.defaultPrevented||n.emit("intersectionOnModelUpdate",t.intersection,t.object)}else n.emit("intersectionHidden")}),n.on("pano.request",function(t){var e=n.emit("wantsMoveToPano",t.state.panoIndex,t.options,t.userAction);e||(e=n.emit("wantsToMoveToPano",t.state.panoIndex,t.options,t.userAction)),e&&t.preventDefault(),t.defaultPrevented||n.emit("panoWillLoad",t.state.panoIndex)}),n.on("pano.select",function(t){n.emit("panoSelected",t.state.panoIndex)}),n.on("pano.moveTo",function(t){n.emit("panoLoaded",t.state.panoIndex),n.emit("moveToPano",t.state.panoIndex,t.userAction),n.emit("panoWillArrive",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.moving",function(t){n.emit("movingToPano",t.state.panoIndex,t.prevPano.panoIndex,t.progress)}),n.on("pano.arrived",function(t){n.emit("panoArrived",t.state.panoIndex,t.state,t.userAction)}),n.on("pano.cancel",function(t){n.emit("moveToPanoCanceled",t.state.panoIndex)}),n.on("pano.error",function(t){n.emit("panoLoadError",t.error,t.state.panoIndex)}),n.on("pano.texture.load",function(t){n.emit("textureStartLoad",t.pano.panoIndex)}),n.on("pano.texture.success",function(t){n.emit("textureLoaded",t.pano.panoIndex,t.meta)}),n.on("pano.texture.error",function(t){n.emit("textureError",t.error,t.pano.panoIndex)}),n.on("pano.texture.abort",function(t){n.emit("textureAbort",t.pano.panoIndex)}),n.on("pano.texture.progress",function(t){n.emit("textureLoading",t.progress,t.pano.panoIndex)}),n.on("xr.session.start",function(t){n.emit("webXRSessionStart")}),n.on("xr.session.end",function(t){n.emit("webXRSessionEnd")}),n.on("xr.gesture.tap",function(t){n.emit("webXRControllerEvent","tap",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.press",function(t){n.emit("webXRControllerEvent","press",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonUp",function(t){n.emit("webXRControllerEvent","buttonUp",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.gesture.buttonDown",function(t){n.emit("webXRControllerEvent","buttonDown",t.buttons,{raycaster:t.controllers.raycaster})}),n.on("xr.controller.update",function(t){n.emit("webXRControllerRayUpdate",{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0}),t.left&&n.emit("webXRAxesUpdate","left",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.left.axes.up,down:t.left.axes.down,left:t.left.axes.left,right:t.left.axes.right},deltaTime:t.left.deltaTime}),t.right&&n.emit("webXRAxesUpdate","right",{raycaster:{leftRay:t.left?t.left.raycaster:void 0,rightRay:t.right?t.right.raycaster:void 0},axesState:{up:t.right.axes.up,down:t.right.axes.down,left:t.right.axes.left,right:t.right.axes.right},deltaTime:t.right.deltaTime})}),n.on("works.request",function(t){n.emit("willLoad",t.input,t.works[0],t.state)}),n.on("works.load",function(t){n.emit("load",t.input,t.works[0],t.state)}),n.on("works.ready",function(t){n.emit("loaded",t.input,t.works[0])}),n.on("state.change",function(t){n.emit("stateChange",t.state,t.userAction)}),n.on("currentState.change",function(t){n.emit("currentStateChange",t.state,t.userAction)}),n.on("state.set",function(t){n.emit("setState",t.state)}),n.on("state.synced",function(t){n.emit("stateSynced",t.state)}),n.on("model.request",function(t){n.emit("modelWillLoad",t.work.model)}),n.on("model.error",function(t){n.emit("modelLoadError",t.error,t.model)}),n.on("model.load",function(t){n.emit("modelLoaded",t.model)}),n.on("model.changeShownFloor",function(t){n.emit("modelShownFloorChange",t.model.shownFloor,t.model.floorLength)}),n.on("render",function(t){n.emit("renderFrame",t.needsRender)}),n.on("mode.change.request",function(t){n.emit("wantsChangeMode",t.mode,t.prevMode)}),n.on("mode.change",function(t){n.emit("modeChange",t.mode,t.prevMode,t.state.panoIndex,t.state,t.userAction)}),n.on("helpers.visible",function(t){n.emit("helpersVisibleChange",t.object.visible)}),n.on("network.resource",function(t){n.emit("network",t.source,t.requestType,t.requestState,t.detail)})}function generateDefaultVideoElement(){if(typeof window!="undefined"){var n=document.createElement("video");n.loop=!0,n.autoplay=!0,n.playsInline=!0,n.muted=!0,n.crossOrigin="";var t=function(){document.removeEventListener("touchstart",t,!1),document.removeEventListener("mousedown",t,!1),n.muted=!1};return document.addEventListener("touchstart",t,!1),document.addEventListener("mousedown",t,!1),n}else return{}}function initLights(){var n=new THREE__namespace.Group;n.name="internalLights";{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction0",t.position.copy(new THREE__namespace.Vector3(0,1,0)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.1);t.name="direction1",t.position.copy(new THREE__namespace.Vector3(-1,-1,-1)),n.add(t)}{var t=new THREE__namespace.DirectionalLight(16777215,.3);t.name="direction2",t.position.copy(new THREE__namespace.Vector3(1,1,1)),n.add(t)}{var t=new THREE__namespace.AmbientLight(16777215,.6);t.name="ambient0",n.add(t)}return n}function parseKeyValue(n){for(var t,e,r={},o=n.split(/(\;|\,)/),s=0,u=o;s<u.length;s++){var l=u[s],c=l.split("="),p=(t=c[0])===null||t===void 0?void 0:t.trim(),f=(e=c[1])===null||e===void 0?void 0:e.trim();p&&f&&(r[p]=f)}return r}function getViewportScale(){var n;if(typeof document!="undefined")for(var t=document.getElementsByTagName("meta"),e=0;e<t.length;e++){var r=t[e];if(r.getAttribute("name")==="viewport"){var o=parseKeyValue((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),s=Number(o["initial-scale"]);if(!isNaN(s))return s}}return 1}const textureURL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqeAOJpGqdJOqrUutgVl2Qb0BWqp/RE8AWWVB7t2KrIzY2Wx2fWKl7yfswgxqj8lYummYa3hfwF9MuQRmbfQE4ocP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SLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var imageSize=[351,63],imageOffset=[20,20],vertices=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),uvs=new Float32Array([0,0,1,0,0,1,1,1]),index=new Uint8Array([0,1,2,1,3,2]),geometry$4=new THREE__namespace.BufferGeometry;geometry$4.setAttribute("position",new THREE__namespace.BufferAttribute(vertices,3));geometry$4.setAttribute("uv",new THREE__namespace.BufferAttribute(uvs,2));geometry$4.setIndex(new THREE__namespace.BufferAttribute(index,1));var material=new THREE__namespace.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),mesh$4=new THREE__namespace.Mesh(geometry$4,material);mesh$4.matrixAutoUpdate=!1;var scene$2=new THREE__namespace.Scene;scene$2.add(mesh$4);scene$2.matrixAutoUpdate=!1;var camera$2=new THREE__namespace.OrthographicCamera(-.5,.5,.5,-.5,.1,1);camera$2.position.set(0,0,.5);camera$2.lookAt(0,0,0);camera$2.updateMatrixWorld(!0);camera$2.matrixAutoUpdate=!1;var prevViewport=new THREE__namespace.Vector4,prevScissor=new THREE__namespace.Vector4;function renderPoweredByRealsee(n){if(material.map){var r=n.getViewport(prevViewport),o=n.getScissor(prevScissor),s=n.getScissorTest(),u=n.autoClear,l=o.x+imageOffset[0]/3,c=o.y+imageOffset[1]/3,p=imageSize[0]/3,f=imageSize[1]/3;n.setViewport(l,c,p,f),n.setScissor(l,c,p,f),n.setScissorTest(!0),n.autoClear=!1,n.render(scene$2,camera$2),n.setViewport(r),n.setScissor(o),n.setScissorTest(s),n.autoClear=u}else{var t=new THREE__namespace.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=THREE__namespace.ClampToEdgeWrapping,t.wrapT=THREE__namespace.ClampToEdgeWrapping,t.minFilter=THREE__namespace.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,material.needsUpdate=!0,e.onload=noop},e.src=textureURL,material.map=t}}var FRAGMENT$2=`
|
|
2134
2134
|
precision mediump float;
|
|
2135
2135
|
precision mediump int;
|
|
2136
2136
|
uniform sampler2D depthBuffer;
|
|
@@ -2246,4 +2246,4 @@ void main() {
|
|
|
2246
2246
|
rgb = clamp(lumCompressed * rgb, 0.0, 1.0);
|
|
2247
2247
|
gl_FragColor = mix(inputColor, vec4(rgb, alpha), progress * 0.9);
|
|
2248
2248
|
}
|
|
2249
|
-
`})||this;return r.material.transparent=!0,r}return 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})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.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((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=function(n){return n.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/")},scratchSphere=new THREE__namespace.Sphere,scratchBox3=new THREE__namespace.Box3,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,p,f,d,h,m,A,g=n.call(this)||this;if(g.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[g.ident]=g),g.renderSwitch01=0,g.currentUpdateArgs={time:now(),args:[]},g.currentMode="Panorama",g.pano={workCode:"",panoIndex:0},g.needsRender=!1,g.modelSceneNeedsRender=!1,g.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,g.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),g.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),g.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,g.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),g.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,g.extraElements=[],g.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},g.fps={testCount:0,testTime:now()},g.modeChangeDuration=(p=e.modeChangeDuration)!==null&&p!==void 0?p:DEFAULT_MODE_CHANGE_DURATION,g.enableWheel=(f=e.enableWheel)!==null&&f!==void 0?f:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&g.throwError(new Error("cannot render a internal renderer")),g.renderer=e.renderer;else try{g.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var y=getViewportScale();g.renderer.setPixelRatio(y===1?window.devicePixelRatio:1),g.renderer.setSize(512,512),g.renderer.setClearColor(g.backgroundColor,g.backgroundAlpha)}catch(O){var v=O instanceof Error?O:new Error(String(O));g.throwError(v)}g.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=g.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),g.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),g.camera=new Camera(DEFAULT_CAMERA_FOV),g.scene=new Scene,g.xrCustomObjectsScene=new THREE__namespace.Scene,g.scene.add(g.xrCustomObjectsScene),g.scene.matrixAutoUpdate=!1,g.loadWorkTask=Promise.resolve(),g.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:DEFAULT_REQUEST_PROXY,g.networkSubscribe=new NetworkSubscribe,g.networkSubscribe.on("network",function(O,F,N,D){var U;g.emit("network.resource",createEvent("network.resource",{source:O,requestType:F,requestState:N,detail:D})),(U=g.analysis)===null||U===void 0||U.network(g.works,O,F,N,D)}),g.boundingMesh=new BoundingMesh$1,g.boundingMesh.name="bounding",g.readyCallbacks=[],g.syncingState=!1,g.helperGroup=new THREE__namespace.Group,g.helperGroup.name="helper",g.helperGroup.matrixAutoUpdate=!1,g.scene.add(g.helperGroup);var E=new Model(emptyWorks[0]);worksMap.set(g,emptyWorks),g.modelScene=new ModelScene,g.modelScene.add(E),g.modelScene.add(g.boundingMesh),defineProperty(E,"loaded",{get:function(){return!1},set:function(O){}}),g.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var b=initLights();g.scene.add(b);var T=new THREE__namespace.Group;defineProperty(T,"children",{get:function(){return b.children},set:function(O){b.children=O}}),defineProperty(T,"visible",{get:function(){return b.visible},set:function(O){b.visible=O}}),defineProperty(T,"name",{get:function(){return b.name},set:function(O){b.name=O}}),g.modelScene.add(T),g.state={mode:g.currentMode,workCode:g.pano.workCode,panoIndex:g.pano.panoIndex,longitude:g.camera.pose.longitude,latitude:g.camera.pose.latitude,fov:g.camera.pose.fov,offset:g.camera.pose.offset.clone(),distance:g.camera.pose.distance},g.stateSynced=!1,g.destroyed=!1,g.paused=!0,typeof window!="undefined"&&(e.play!==!1&&g.play(),g.stopAnimationLoop=AnimationFrameLoop.shared.add(function(O,F){for(var N=[],D=2;D<arguments.length;D++)N[D-2]=arguments[D];g.updateTime.apply(g,__spreadArray([O,F],N,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&g.currentMode==="VRPanorama"&&g.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},S=function(){g.needsRender=!0,g.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.addEventListener("webglcontextrestored",S,!1),g.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.removeEventListener("webglcontextrestored",S,!1)},g.plugins={},e.plugins&&e.plugins.length)for(var R=0,w=e.plugins;R<w.length;R++){var M=w[R];if(typeof M=="function")M(g);else if(Array.isArray(M)){var B=M[0],C=M[1],P=M[2];if(typeof B=="function"){var L=B(g,P);typeof C=="string"&&(g.plugins[C]?g.throwError(new Error("plugin name ".concat(C," is exists."))):g.plugins[C]=L)}}}return initLegacyEvent(g),g.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,g._buildInRendererType="default",g._builtinRenderer=null,g}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.1"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"useNativeImageBitmap",{get:function(){return canUseNativeImageBitmap()},set:function(e){useNativeImageBitmap(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var r=this.getElement();r&&r.parentNode&&r.parentNode.removeChild(r);var o=this.modelScene.parameter;o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((e=o.pano0)===null||e===void 0?void 0:e.map)&&o.pano1.map.dispose(),o.reset("pano0","pano1");for(var s=0,u=this.modelScene.children.slice();s<u.length;s++){var l=u[s];l.dispose&&l.dispose(),this.modelScene.remove(l)}this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&(this.renderer.render(new THREE__namespace.Scene,new THREE__namespace.Camera),this.renderer.setAnimationLoop(null)),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var s=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);s||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){var o,s;if(e===void 0&&(e={}),!!this.renderer){var u=this.renderer.domElement,l=u.parentNode,c=e.width,p=c===void 0?(o=l==null?void 0:l.offsetWidth)!==null&&o!==void 0?o:512:c,f=e.height,d=f===void 0?(s=l==null?void 0:l.offsetHeight)!==null&&s!==void 0?s:512:f;r=r!=null?r:this.renderer.getPixelRatio();var h=this.renderer.capabilities.maxTextureSize,m=Math.max(p,d)*r;m>h&&(r=r/m*h,r=Math.floor(r*100)/100),this.renderer.setPixelRatio(r),this.renderer.setSize(p,d),this.needsRender=!0,this.modelSceneNeedsRender=!0;var A=now(),g=A-this.currentUpdateArgs.time,y=this.currentUpdateArgs.args;this.updateTime(A,g,y)}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.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.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,p,f,d,h,m,A,g,y;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var E=[];if(Array.isArray(e))for(var b=0,T=e;b<T.length;b++){var _=T[b];_ instanceof Work?E.push(_):typeof _!="string"&&"work"in _?E.push(parseWork(_.work,_)):E.push(parseWork(_))}else e instanceof Work?E.push(e):E.push(parseWork(e));for(var S=createWorks(E),R=function(Y){var G=w,ee=new Fetcher({get networkSubscribe(){return G.networkSubscribe},requestProxy:function(te){return Promise.resolve(te).then(function(ne){return G.requestProxy(ne)}).then(function(ne){var ae=verifyURL(ne,Y.allowHosts);if(ae instanceof Error)throw ae;return ae})}});registerFetcher(Y,ee)},w=this,M=0,B=S;M<B.length;M++){var C=B[M];R(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var P=S.initial,L=P.work.observers[0],O=L?{workCode:L.work.workCode,panoIndex:L.panoIndex}:{workCode:P.work.workCode,panoIndex:0},F=(l=P.mode)!==null&&l!==void 0?l:L?"Panorama":"Mapview",N={};if(r==="inherit"){F=this.currentMode;var D=(p=(c=S[0])===null||c===void 0?void 0:c.observers)===null||p===void 0?void 0:p[this.panoIndex];D?O={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?O={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),N={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof P.panoIndex=="number"&&(O={workCode:P.work.workCode,panoIndex:P.panoIndex}),P.mode&&(F=P.mode),N={longitude:P.longitude,latitude:P.latitude,fov:P.fov,distance:P.distance,offset:(f=P.offset)===null||f===void 0?void 0:f.clone()};else{if(F=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(m=(h=r.workCode)!==null&&h!==void 0?h:P.work.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex});D&&(O={workCode:D.work.workCode,panoIndex:D.panoIndex})}N={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var U=__assign(__assign(__assign({},O),{mode:F}),N),z=this.getCurrentState(),K=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(F==="Floorplan"||F==="Topview"||F==="Mapview")&&this.currentMode===F&&(K=0);var j="fly";(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&this.currentMode===F&&(j=(g=v.effect)!==null&&g!==void 0?g:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:U,userAction:s}));var Q=function(){u.pano=O;var Y=__assign(__assign({initial:{state:U,currentState:z,duration:K,effect:j,userAction:s}},u.commonParams()),u.controllerInits[F]),G=Controllers[F].initAnimationEndState(Y);if(u.controller&&u.currentMode===F)u.controller.updateWork(S,G,{effect:j,duration:K},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(F,Y));else{var ee=u.currentMode;if(u.controller)u.controller.destroy();else{var te=Controllers[F].initAnimationEndState(Y);u.camera.setFromPose(te),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(F,Y);var ne=createEvent("mode.change",{prevMode:ee,mode:F,state:G,userAction:s});try{u.emit("mode.change",ne)}catch(ae){console.error(ae)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var V=Promise.resolve();if(F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(U),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=F);var J=this.loadModels(S,v);V=Promise.all(J.map(function(Y){return Y.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,Q(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{Q();var W=this.controller,X=!1;this.modelScene.autoRefine=!1;var Z=function(){u.works===S&&X===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),X=!0,u.modelScene.autoRefine=!0),W.off("pano.arrived",Z),W.off("pano.cancel",Z)},J=this.loadModels(S,v);V=Promise.all(J.map(function(G){return G.initReady})).then(noop),W.once("pano.arrived",Z),W.once("pano.cancel",Z),setTimeout(Z,((y=v.duration)!==null&&y!==void 0?y:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),V.then(function(){return u.ready()}).then(function(){var Y;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(Y=u.analysis)===null||Y===void 0||Y.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var p=parseWork(null),f=new Model(p);f.work=p,worksMap.set(e,createWorks([p])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,p){var f,d,h,m;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(f=o==null?void 0:o.duration)!==null&&f!==void 0?f:l.modeChangeDuration);var g="fly";l.controller&&typeof o=="object"&&o.effect&&(g=o.effect);var y=typeof r.panoIndex=="number"?{workCode:(m=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),p(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(y)){var v=new Error("PanoId ".concat(panoStringify(y)," not existed."));l.throwError(v),p(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var E=l.controller,b=l.currentMode,T=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,y)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(y,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,y)||(l.pano=y),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),y),R=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:g,userAction:s}},l.commonParams()),l.controllerInits[e]),w=Controllers[e].initAnimationEndState(R),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:w,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){E&&E.destroy(),l.controller=l.applyController(e,R);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:w,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return T()}).catch(function(S){var R=S instanceof Error?S:new Error(String(S));l.exitFullscreen(),l.throwError(R),p(R)});else if(e===t.Mode.XRPanorama){var _=AnimationFrameLoop.shared.getContext();_?_.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),T()}).catch(function(S){var R=S instanceof Error?S:new Error(String(S));l.throwError(R),p(R)})}else T()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var p=this.renderer.getPixelRatio(),f=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,m=0,A=1,g=1,y,v,E,b,T;typeof e=="number"?(h=e,typeof r=="number"&&(m=r),typeof o=="number"&&(A=o),typeof s=="number"&&(g=s),y=u,v=l,T=c):(h=e.x,m=e.y,A=e.width,g=e.height,y=e.pixelRatio,v=e.flipY,E=e.helperVisible,b=e.skipPanorama,T=e.buffer),h=Math.ceil(h),m=Math.ceil(m),A=Math.ceil(A),g=Math.ceil(g),y=Math.ceil(y!=null?y:p),v=v!=null?v:!1;var _=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=E!=null?E:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var R=this.getPixelsRenderTarget;R.setSize(A*y,g*y),this.renderer.setRenderTarget(R),this.camera.pixelRatio=y,this.camera.resolution.set(A,g),this.camera.setViewOffset(d.width,d.height,h,d.height-m-g,A,g),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=_,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(f),this.camera.clearViewOffset(),this.camera.pixelRatio=p,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var w=A*y,M=g*y,B=w*M,C=B*4;if(T){if(T.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else T=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(R,0,0,A*y,g*y,T),v)for(var P=B/2,L=0,O=0,F=0,N=0;O<P;O++)for(N=(M-Math.floor(O/w)-1)*w+O%w,F=0;F<4;F++)L=T[O*4+F],T[O*4+F]=T[N*4+F],T[N*4+F]=L;return T},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,p=scratchClearColor.copy(r.getClearColor()),f=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),m=r.getScissorTest(),A=r.getSize(scratchRenderSize),g=r.getPixelRatio(),y=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),E=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(y,v,E,b),r.setScissor(y,v,E,b);var T=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(T);var _=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:_,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,g),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=_,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(p,f),r.setViewport(d),r.setScissor(h),r.setScissorTest(m),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.boundingMesh);var c=scratchBox3.getBoundingSphere(scratchSphere),p=c.radius*2;c.containsPoint(this.camera.position)||(p=this.camera.position.distanceTo(c.center)+c.radius),p=clamp$1(p,800);var f=p/1e4;f=clamp$1(f,.03,.1),this.camera.near!==f&&(this.camera.near=f),this.camera.far!==p&&(this.camera.far=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var m=[],A=0,g=this.modelScene.children;A<g.length;A++){var y=g[A];y instanceof Model&&y.outdated&&m.push(y)}for(var v=0,E=m;v<E.length;v++){var b=E[v];this.modelScene.remove(b),b.dispose()}if(m.length>0)for(var T=0,_=this.modelScene.children;T<_.length;T++){var y=_[T];y instanceof Model&&(y.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var R=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",R),R.defaultPrevented&&(this.needsRender=!1);var w=this.needsRender;this.renderer&&w&&this.render(),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.emit("render",createEvent("render",{needsRender:w})),this.hasListener("fps")&&(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 InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var p={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(p,r,o):c&&(this.pano=p,this.once("initAnimation.start",function(f){r.moveStartCallback&&r.moveStartCallback(f.state)}),this.once("initAnimation.end",function(f){r.moveEndCallback&&r.moveEndCallback(f.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var p=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),f=__assign({key:"pano.".concat(p,".").concat(c)},pick(o.imageOptions,["size","format","quality","forceUseExifOrientation","mappings"])),d=s.work.getURL(s.images[c]),h=o.imageOptions.transform?o.imageOptions.transform(d,f):imageURL(d,f);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var p=this.renderer.getSize(new THREE__namespace.Vector2),f=p.x*this.viewport.width,d=p.y*this.viewport.height,h=p.x*this.viewport.left+(c.x+1)/2*f,m=p.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,m)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,p,f,d,h,m,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=pick(e,["mode","workCode","panoIndex","longitude","latitude","fov","offset","distance"]),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var g;if(typeof e.panoIndex=="number")if(e.workCode)g={workCode:e.workCode,panoIndex:e.panoIndex};else{var y=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(P){return P.workCode===v}).length>0&&(y=v),g={workCode:y,panoIndex:e.panoIndex}}var E=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,T,_,S,R;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==E){if(E==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var w={workCode:g==null?void 0:g.workCode,panoIndex:g==null?void 0:g.panoIndex};typeof e.longitude=="number"&&(w.longitude=e.longitude),typeof e.latitude=="number"&&(w.latitude=e.latitude),typeof e.fov=="number"&&(w.fov=e.fov),typeof e.distance=="number"&&(w.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(w.offset=e.offset);var M=__assign(__assign({initial:{state:w,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[E]),B=Controllers[E].initAnimationEndState(M);b=B.longitude,T=B.latitude,_=B.fov,S=B.offset,R=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,T=(p=e.latitude)!==null&&p!==void 0?p:this.state.latitude,_=(f=e.fov)!==null&&f!==void 0?f:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,R=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(g!=null?g:this.pano).workCode,panoIndex:(g!=null?g:this.pano).panoIndex,mode:E,longitude:b,latitude:T,fov:_,offset:S,distance:R};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,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,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var p=1,f=.2,d=.2,h=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,p),A=Math.abs(this.camera.pose.distance-this.state.distance),g=A>d*15?A/15:f,y=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,g),v=this.camera.pose.offset.distanceTo(this.state.offset),E=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,E),T=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),_=T.longitude,S=T.latitude;if(notSimilarValue(m,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(y,this.camera.pose.distance)||notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var R={x:b.x,y:b.y,z:b.z},w={fov:m};return Object.assign(R,{distance:y}),Object.assign(w,{longitude:_,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(w,0).catch(noop),this.controller.locationMotion.set(R,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),_=C.longitude,S=C.latitude,y=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(y,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:_,latitude:S,fov:m},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var P=this.currentMode,L=P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model;if(!L||this.modelScene.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,N=O;F<N.length;F++){var D=N[F];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,p,f,d=new Map,h=!1,m=[],A=0,g=this.modelScene.children;A<g.length;A++){var y=g[A];y instanceof Model&&(y.outdated=!0,d.set(y.work.workCode,y),h=!0)}for(var v=function(T){var _=e[T],S=_.workCode&&d.get(_.workCode);if(S)S.work=_,S.outdated=!1,d.delete(_.workCode),m.push(S);else{var R=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:E.textureOptions,w=(p=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&p!==void 0?p:r["3d-tiles"],M=new Model(_,{light:(f=r.model)===null||f===void 0?void 0:f.light,textureOptions:R});M.initReady.then(function(){if(w)if(typeof w=="function")for(var O=0,F=M.viewLayers;O<F.length;O++){var N=F[O],D=w(N,M,T);D&&(D.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(D.viewerRequestVolume)),N.parameter.set(omit(D,["showLayers"])),D.showLayers===!1?N.visible=!1:Array.isArray(D.showLayers)&&(N.visible=D.showLayers.includes(N.name)))}else for(var U=0,z=M.viewLayers;U<z.length;U++){var N=z[U];w.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(w.viewerRequestVolume)),N.parameter.set(omit(w,["showLayers"])),w.showLayers===!1?N.visible=!1:Array.isArray(w.showLayers)&&(N.visible=w.showLayers.includes(N.name))}}),m.push(M),h&&(M.visible=!1),E.modelScene.add(M);var B=function(){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:_,model:M,error:null}))},!0)},C=function(O){var F=O.error;o.emit("model.error",createEvent("model.error",{work:_,model:M,error:F})),o.throwError(F)},P=function(){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:_,model:M,error:null}))},L=function(){M.removeEventListener("load",B),M.removeEventListener("error",C),M.removeEventListener("changeShownFloor",P),M.removeEventListener("dispose",L)};M.addEventListener("load",B),M.addEventListener("error",C),M.addEventListener("changeShownFloor",P),M.addEventListener("dispose",L),E.emit("model.request",createEvent("model.request",{work:_,model:M,error:null}))}},E=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,m},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,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(m){u.on(m,function(){for(var A=[],g=0;g<arguments.length;g++)A[g]=arguments[g];var y=o.emit.apply(o,__spreadArray([m],A,!1));if(y)return!1})},c=0,p=PROXY_CONTROLLER_EVENT_NAMES;c<p.length;c++){var f=p[c];l(f)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(m){var A;if(o.controller){var g=o.controller.getTargetState();m.userAction&&o.syncingState===!1&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:m.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:m.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(m){var A,g=m.state,y=m.userAction;y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(m){var A,g=m.state,y=m.userAction;y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A=m.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(m){o.emit("pano.request",m),m.defaultPrevented||o.moveToPano(m.state,m.options,m.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(m){return o.throwError(m)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1;var o=new THREE__namespace.Vector3(0,0,-1);o.applyQuaternion(this.camera.quaternion);var s=r.quaternion.clone().inverse();o.applyQuaternion(s);var u=Math.atan2(o.x,-o.z),l=-Math.asin(o.y);return{theta:u,phi:l,lookAtVector:o}}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={constructor:Five,THREE:THREE__namespace,instances:{}};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop;exports.Camera=Camera;exports.CustomShader=PBMCustomShader;exports.Fetcher=Fetcher;exports.Five=Five;exports.InternalWebGLRenderer=InternalWebGLRenderer;exports.Model=Model;exports.ModelScene=ModelScene;exports.Motion=Motion;exports.NetworkSubscribe=NetworkSubscribe;exports.PBMContainer=PBMContainer;exports.PBMCustomShader=PBMCustomShader;exports.PBMGroup=PBMGroup;exports.PBMMesh=PBMMesh;exports.PBMMeshMaterial=PBMMeshMaterial;exports.PBMPointCloud=PBMPointCloud;exports.PBMPointCloudMaterial=PBMPointCloudMaterial;exports.PBMSkinnedMesh=PBMSkinnedMesh;exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES;exports.PanoCircleMesh=PanoCircleMesh;exports.PanoCircleMeshCustom=PanoCircleMeshCustom;exports.PanoCircleMeshSolid=PanoCircleMeshSolid;exports.Parameter=Parameter;exports.Scene=Scene;exports.Subscribe=Subscribe;exports.TextureLoader=TextureLoader;exports.Tile=Tile;exports.Tile3DModel=Tile3D;exports.TileCache=TileCache;exports.TileNode=TileNode;exports.TileRequestScheduler=TileRequestScheduler;exports.Tileset=Tileset;exports.Trajectory=Trajectory;exports.TrajectoryNode=TrajectoryNode;exports.Work=Work;exports.WorkResolvedObserver=WorkResolvedObserver;exports.XRButton=XRButton;exports.controllersDefaultInitArgs=controllersDefaultInitArgs;exports.coordinatesToVector=coordinatesToVector;exports.createDebugBoundingMesh=createDebugBoundingMesh;exports.createWorks=createWorks;exports.defaultImageURLTransform=imageURL;exports.draco=draco;exports.getViewportScale=getViewportScale;exports.headingToLongitude=headingToLongitude;exports.imageSupport=imageSupport;exports.isBoundingVolume=isBoundingVolume;exports.isPanoId=isPanoId;exports.ktx2=ktx2;exports.loadAt3d=loadAt3d;exports.loadB3dm=loadB3dm;exports.loadDome=loadDome;exports.loadDomez=loadDomez;exports.loadFbx=loadFbx;exports.loadGltf=loadGltf;exports.loadPbm=loadPbm;exports.loadPly=loadPly;exports.loadPnts=loadPnts;exports.loadX3p=loadX3p;exports.longitudeToHeading=longitudeToHeading;exports.makeBoundingVolume=makeBoundingVolume;exports.panoEqual=panoEqual;exports.panoParse=panoParse;exports.panoStringify=panoStringify;exports.parseWork=parseWork;exports.vectorToCoordinates=vectorToCoordinates;exports.workToJson=workToJson;
|
|
2249
|
+
`})||this;return r.material.transparent=!0,r}return 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})(Pass),LuminanceAdaptiveEffect=(function(n){__extends(t,n);function t(e,r,o,s){var u=n.call(this,e,r,o,s)||this;return u.enableTime=now(),u.renderer=e,u.valuePass=new ValuePass(u.renderer),u.luminancePass=new LuminancePass(u.renderer,Math.sqrt(1/3)),u.nextStepPass=new NextStepPass(u.renderer,.01),u.luminanceAdaptivePass=new LuminanceAdaptivePass(u.renderer),u}return t.prototype.render=function(e){this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.enableTime===null&&(this.enableTime=now()),this.luminanceTargetBuffer||(this.luminanceTargetBuffer=new THREE__namespace.WebGLRenderTarget(128,128,{minFilter:THREE__namespace.LinearMipmapLinearFilter,magFilter:THREE__namespace.LinearFilter,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1,format:THREE__namespace.RGBAFormat,generateMipmaps:!0}),this.nextStepPass.targetBuffer=this.luminanceTargetBuffer.texture),this.luminancePass.render(e[0],this.luminanceTargetBuffer),this.luminancePrevBuffer||(this.luminancePrevBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.Vector3(.5,.5,.5),this.luminancePrevBuffer)),this.luminanceNextBuffer||(this.luminanceNextBuffer=new THREE__namespace.WebGLRenderTarget(1,1,{minFilter:THREE__namespace.NearestFilter,magFilter:THREE__namespace.NearestFilter,type:THREE__namespace.HalfFloatType,encoding:this.renderer.outputEncoding,stencilBuffer:!1,depthBuffer:!1}),this.valuePass.render(new THREE__namespace.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((now()-this.enableTime)/100,1),this.luminanceAdaptivePass.render(e[0],e[1])},t.prototype.dispose=function(){var e,r,o;(e=this.luminanceTargetBuffer)===null||e===void 0||e.dispose(),(r=this.luminancePrevBuffer)===null||r===void 0||r.dispose(),(o=this.luminanceNextBuffer)===null||o===void 0||o.dispose(),this.copyPass.dispose(),this.luminancePass.dispose(),this.nextStepPass.dispose(),this.luminanceAdaptivePass.dispose()},t})(Effect),sharedV2=new THREE__namespace.Vector2,LuminanceRenderer=(function(n){__extends(t,n);function t(e){var r,o,s=n.call(this,e)||this;s.type="default",s.luminanceAdaptiveEffect=new LuminanceAdaptiveEffect(s.renderer,s.modelScene,s.camera,s.modelScene);var u=s.renderer.getDrawingBufferSize(sharedV2);return s.screenBuffers=[new THREE__namespace.WebGLRenderTarget(u.x,u.y,{generateMipmaps:!1,encoding:(o=(r=s.renderer)===null||r===void 0?void 0:r.outputEncoding)!==null&&o!==void 0?o:THREE__namespace.sRGBEncoding}),s.enableFragDepth?s.modelRenderTarget:null],s}return t.prototype.render=function(e){var r=this.renderer.getRenderTarget();this.enableFragDepth?(e&&(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers)),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,r),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,r),this.renderer.setRenderTarget(r),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0):(this.luminanceAdaptiveEffect.enable=!0,this.luminanceAdaptiveEffect.render(this.screenBuffers),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0),this.modelScene.needsRender=!0},t})(BaseRenderer),DEFAULT_MODE_CHANGE_DURATION=1e3,DEFAULT_CAMERA_FOV=90,DEFAULT_REQUEST_PROXY=function(n){return n.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/")},scratchSphere=new THREE__namespace.Sphere,scratchBox3=new THREE__namespace.Box3,scratchViewport=new THREE__namespace.Vector4,scratchScissor=new THREE__namespace.Vector4,scratchClearColor=new THREE__namespace.Color,scratchRenderSize=new THREE__namespace.Vector2,worksMap=new WeakMap,emptyWorks=createWorks([parseWork(null)]),Five=(function(n){__extends(t,n);function t(e){e===void 0&&(e={});var r,o,s,u,l,c,p,f,d,h,m,A,g=n.call(this)||this;if(g.ident=createUuid(),typeof window!="undefined"&&(__FIVE_DEBUG__.instances[g.ident]=g),g.renderSwitch01=0,g.currentUpdateArgs={time:now(),args:[]},g.currentMode="Panorama",g.pano={workCode:"",panoIndex:0},g.needsRender=!1,g.modelSceneNeedsRender=!1,g.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,g.imageOptions=__assign({},(o=e.imageOptions)!==null&&o!==void 0?o:{}),g.textureOptions=__assign({},(s=e.textureOptions)!==null&&s!==void 0?s:{}),g.poweredByRealsee=(u=e.poweredByRealsee)!==null&&u!==void 0?u:!0,g.backgroundColor=new THREE__namespace.Color((l=e.backgroundColor)!==null&&l!==void 0?l:1579548),g.backgroundAlpha=(c=e.backgroundAlpha)!==null&&c!==void 0?c:1,g.extraElements=[],g.controllerInits={Panorama:Object.assign({},e.panorama),Model:Object.assign({},e.model),Floorplan:Object.assign({},e.floorplan),Topview:Object.assign({},e.topview),Mapview:Object.assign({},e.mapview),VRPanorama:Object.assign({},e.vrPanorama),XRPanorama:Object.assign({},e.xrPanorama)},g.fps={testCount:0,testTime:now()},g.modeChangeDuration=(p=e.modeChangeDuration)!==null&&p!==void 0?p:DEFAULT_MODE_CHANGE_DURATION,g.enableWheel=(f=e.enableWheel)!==null&&f!==void 0?f:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof InternalWebGLRenderer&&g.throwError(new Error("cannot render a internal renderer")),g.renderer=e.renderer;else try{g.renderer=new InternalWebGLRenderer({preserveDrawingBuffer:e.preserveDrawingBuffer,antialias:e.antialias,webgl2:e.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision,powerPreference:e.powerPreference});var y=getViewportScale();g.renderer.setPixelRatio(y===1?window.devicePixelRatio:1),g.renderer.setSize(512,512),g.renderer.setClearColor(g.backgroundColor,g.backgroundAlpha)}catch(O){var v=O instanceof Error?O:new Error(String(O));g.throwError(v)}g.getPixelsRenderTarget=new THREE__namespace.WebGLRenderTarget(1,1,{encoding:(h=(d=g.renderer)===null||d===void 0?void 0:d.outputEncoding)!==null&&h!==void 0?h:THREE__namespace.sRGBEncoding,generateMipmaps:!1}),g.viewport=Object.assign({left:0,bottom:0,width:1,height:1},e.viewport),g.camera=new Camera(DEFAULT_CAMERA_FOV),g.scene=new Scene,g.xrCustomObjectsScene=new THREE__namespace.Scene,g.scene.add(g.xrCustomObjectsScene),g.scene.matrixAutoUpdate=!1,g.loadWorkTask=Promise.resolve(),g.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:DEFAULT_REQUEST_PROXY,g.networkSubscribe=new NetworkSubscribe,g.networkSubscribe.on("network",function(O,F,N,D){var U;g.emit("network.resource",createEvent("network.resource",{source:O,requestType:F,requestState:N,detail:D})),(U=g.analysis)===null||U===void 0||U.network(g.works,O,F,N,D)}),g.boundingMesh=new BoundingMesh$1,g.boundingMesh.name="bounding",g.readyCallbacks=[],g.syncingState=!1,g.helperGroup=new THREE__namespace.Group,g.helperGroup.name="helper",g.helperGroup.matrixAutoUpdate=!1,g.scene.add(g.helperGroup);var E=new Model(emptyWorks[0]);worksMap.set(g,emptyWorks),g.modelScene=new ModelScene,g.modelScene.add(E),g.modelScene.add(g.boundingMesh),defineProperty(E,"loaded",{get:function(){return!1},set:function(O){}}),g.videoTexture=new THREE__namespace.VideoTexture(e.videoInstance||generateDefaultVideoElement());var b=initLights();g.scene.add(b);var T=new THREE__namespace.Group;defineProperty(T,"children",{get:function(){return b.children},set:function(O){b.children=O}}),defineProperty(T,"visible",{get:function(){return b.visible},set:function(O){b.visible=O}}),defineProperty(T,"name",{get:function(){return b.name},set:function(O){b.name=O}}),g.modelScene.add(T),g.state={mode:g.currentMode,workCode:g.pano.workCode,panoIndex:g.pano.panoIndex,longitude:g.camera.pose.longitude,latitude:g.camera.pose.latitude,fov:g.camera.pose.fov,offset:g.camera.pose.offset.clone(),distance:g.camera.pose.distance},g.stateSynced=!1,g.destroyed=!1,g.paused=!0,typeof window!="undefined"&&(e.play!==!1&&g.play(),g.stopAnimationLoop=AnimationFrameLoop.shared.add(function(O,F){for(var N=[],D=2;D<arguments.length;D++)N[D-2]=arguments[D];g.updateTime.apply(g,__spreadArray([O,F],N,!1))},!1,0,10));var _=function(){typeof document!="undefined"&&document.fullscreenElement===null&&g.currentMode==="VRPanorama"&&g.controller.emit("vr.requestExit",createEvent("vr.requestExit",{}))},S=function(){g.needsRender=!0,g.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.addEventListener("webglcontextrestored",S,!1),g.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",_,!1),g.renderer&&g.renderer.domElement.removeEventListener("webglcontextrestored",S,!1)},g.plugins={},e.plugins&&e.plugins.length)for(var R=0,w=e.plugins;R<w.length;R++){var M=w[R];if(typeof M=="function")M(g);else if(Array.isArray(M)){var B=M[0],C=M[1],P=M[2];if(typeof B=="function"){var L=B(g,P);typeof C=="string"&&(g.plugins[C]?g.throwError(new Error("plugin name ".concat(C," is exists."))):g.plugins[C]=L)}}}return initLegacyEvent(g),g.enableLayeringRendering=(A=e.enableLayeringRendering)!==null&&A!==void 0?A:!1,g._buildInRendererType="default",g._builtinRenderer=null,g}return Object.defineProperty(t,"version",{get:function(){return"6.7.0-alpha.3"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return draco.decoderPath},set:function(e){draco.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return ktx2.transcoderPath},set:function(e){ktx2.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"useNativeImageBitmap",{get:function(){return canUseNativeImageBitmap()},set:function(e){useNativeImageBitmap(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e;if(this.destroyed!==!0){delete __FIVE_DEBUG__.instances[this.ident],this.emit("dispose"),this.destroyed=!0,this.pause(),this.stopAnimationLoop&&(this.stopAnimationLoop(),this.stopAnimationLoop=void 0),this.off(),this.networkSubscribe.off(),this.controller&&(this.controller.destroy(),this.controller=void 0);var r=this.getElement();r&&r.parentNode&&r.parentNode.removeChild(r);var o=this.modelScene.parameter;o.pano0&&o.pano0.map.dispose(),o.pano1&&o.pano1.map!==((e=o.pano0)===null||e===void 0?void 0:e.map)&&o.pano1.map.dispose(),o.reset("pano0","pano1");for(var s=0,u=this.modelScene.children.slice();s<u.length;s++){var l=u[s];l.dispose&&l.dispose(),this.modelScene.remove(l)}this.modelScene.dispose(),this.scene.dispose(),this.xrCustomObjectsScene.dispose(),worksMap.set(this,emptyWorks),this.renderer&&(this.renderer.render(new THREE__namespace.Scene,new THREE__namespace.Camera),this.renderer.setAnimationLoop(null)),this.renderer instanceof InternalWebGLRenderer&&(this.renderer.forceContextLoss&&this.renderer.forceContextLoss(),this.renderer.dispose())}},t.prototype.setViewport=function(e){Object.assign(this.viewport,e),this.needsRender=!0,this.modelSceneNeedsRender=!0},Object.defineProperty(t.prototype,"helperVisible",{get:function(){return this.helperGroup.visible},set:function(e){this.helperGroup.visible!==e&&(this.helperGroup.visible=e,this.emit("helpers.visible",createEvent("helpers.visible",{object:this.helperGroup})),this.needsRender=!0)},enumerable:!1,configurable:!0}),t.prototype.getBuiltinRenderer=function(e){var r=this._builtinRenderer;if((r==null?void 0:r.type)!==this._buildInRendererType)switch(r&&r.dispose(),this._buildInRendererType){case"default":this._builtinRenderer=new DefaultRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"edl":this._builtinRenderer=new EDLRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"hq":this._builtinRenderer=new HQRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break;case"luminance":this._builtinRenderer=new LuminanceRenderer({renderer:e,camera:this.camera,scene:this.scene,modelScene:this.modelScene,enableLayeringRendering:this.enableLayeringRendering});break}return this._builtinRenderer},Object.defineProperty(t.prototype,"renderEffect",{get:function(){return this._buildInRendererType},set:function(e){this._buildInRendererType=e,this.modelSceneNeedsRender=!0},enumerable:!1,configurable:!0}),t.prototype.updateConfiguration=function(e,r){r===void 0&&(r=!0);var o=!1;if(e.panorama&&(Object.assign(this.controllerInits.Panorama,omitUndefinedFields(e.panorama)),this.currentMode==="Panorama"&&(o=!0)),e.model&&(Object.assign(this.controllerInits.Model,omitUndefinedFields(e.model)),this.currentMode==="Model"&&(o=!0)),e.floorplan&&(Object.assign(this.controllerInits.Floorplan,omitUndefinedFields(e.floorplan)),this.currentMode==="Floorplan"&&(o=!0)),e.topview&&(Object.assign(this.controllerInits.Topview,omitUndefinedFields(e.topview)),this.currentMode==="Topview"&&(o=!0)),e.mapview&&(Object.assign(this.controllerInits.Mapview,omitUndefinedFields(e.mapview)),this.currentMode==="Mapview"&&(o=!0)),e.vrPanorama&&(Object.assign(this.controllerInits.VRPanorama,omitUndefinedFields(e.vrPanorama)),this.currentMode==="VRPanorama"&&(o=!0)),e.imageOptions&&(Object.assign(this.imageOptions,e.imageOptions),(this.currentMode==="Panorama"||this.currentMode==="VRPanorama")&&(o=!0)),e.textureOptions&&Object.assign(this.textureOptions,e.textureOptions),r&&o&&this.controller&&this.currentMode){var s=this.controller.updateConfiguration(this.controllerInits[this.currentMode]);s||this.changeMode(this.currentMode,this.getCurrentState(),0,!1,!0)}},t.prototype.appendTo=function(e,r){if(r===void 0&&(r={}),!!this.renderer){if(!(this.renderer instanceof InternalWebGLRenderer)){this.throwError(new Error("cannot call appendTo method when render a external renderer"));return}var o=this.getElement();if(o){e.appendChild(o),this.refresh(r);var s=window.getComputedStyle(e).position;s!=="relative"&&s!=="absolute"&&s!=="fixed"&&s!=="sticky"&&(e.style.position="relative")}}},t.prototype.refresh=function(e,r){var o,s;if(e===void 0&&(e={}),!!this.renderer){var u=this.renderer.domElement,l=u.parentNode,c=e.width,p=c===void 0?(o=l==null?void 0:l.offsetWidth)!==null&&o!==void 0?o:512:c,f=e.height,d=f===void 0?(s=l==null?void 0:l.offsetHeight)!==null&&s!==void 0?s:512:f;r=r!=null?r:this.renderer.getPixelRatio();var h=this.renderer.capabilities.maxTextureSize,m=Math.max(p,d)*r;m>h&&(r=r/m*h,r=Math.floor(r*100)/100),this.renderer.setPixelRatio(r),this.renderer.setSize(p,d),this.needsRender=!0,this.modelSceneNeedsRender=!0;var A=now(),g=A-this.currentUpdateArgs.time,y=this.currentUpdateArgs.args;this.updateTime(A,g,y)}},t.prototype.addExtraElement=function(e){var r=this;return this.extraElements.indexOf(e)===-1&&(this.extraElements.push(e),this.controller&&this.controller.bindExtraElement(e)),function(){return r.removeExtraElement(e)}},t.prototype.removeExtraElement=function(e){var r=this.extraElements.indexOf(e);r!==-1&&(this.extraElements.splice(r,1),this.controller&&this.controller.unbindExtraElement(e))},t.prototype.getSize=function(e){if(!this.renderer)throw new Error("renderer is not initialized");return this.renderer.getSize(e),e.x*=this.viewport.width,e.y*=this.viewport.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.viewport.width,e.y*=this.viewport.height,e},t.prototype.updateCamera=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCamera(e,r,o)},t.prototype.updateCameraWithKeyframes=function(e,r,o){if(o===void 0&&(o=!0),!this.controller)throw new Error("controller is not initialized.");return this.controller.updateCameraWithKeyframes(e,r,o)},Object.defineProperty(t.prototype,"works",{get:function(){var e=worksMap.get(this);return e||emptyWorks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"work",{get:function(){return this.works[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observers",{get:function(){return this.work.observers},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"models",{get:function(){return this.modelScene.models},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"model",{get:function(){return this.modelScene.models[0]},enumerable:!1,configurable:!0}),t.prototype.load=function(e,r,o,s){var u=this;if(s===void 0&&(s=!0),!this.renderer)throw new Error("renderer is not initialized");var l=this.loadWorkTask.then(function(){return isPromise(e)?e.then(function(c){return u.load_(c,r,o,s)}):u.load_(e,r,o,s)});return this.loadWorkTask=l.catch(function(c){u.throwError(c)}),l},t.prototype.load_=function(e,r,o,s){var u=this,l,c,p,f,d,h,m,A,g,y;s===void 0&&(s=!0);var v={};typeof o=="number"?v.duration=o:typeof o=="object"&&Object.assign(v,o),this.works===emptyWorks&&(v.duration===void 0&&(v.duration=0),v.effect===void 0&&(v.effect="instant"));var E=[];if(Array.isArray(e))for(var b=0,T=e;b<T.length;b++){var _=T[b];_ instanceof Work?E.push(_):typeof _!="string"&&"work"in _?E.push(parseWork(_.work,_)):E.push(parseWork(_))}else e instanceof Work?E.push(e):E.push(parseWork(e));for(var S=createWorks(E),R=function(Y){var G=w,ee=new Fetcher({get networkSubscribe(){return G.networkSubscribe},requestProxy:function(te){return Promise.resolve(te).then(function(ne){return G.requestProxy(ne)}).then(function(ne){var ae=verifyURL(ne,Y.allowHosts);if(ae instanceof Error)throw ae;return ae})}});registerFetcher(Y,ee)},w=this,M=0,B=S;M<B.length;M++){var C=B[M];R(C)}r===void 0&&(r="inherit"),r==="inherit"&&this.works===emptyWorks&&(r="initial");var P=S.initial,L=P.work.observers[0],O=L?{workCode:L.work.workCode,panoIndex:L.panoIndex}:{workCode:P.work.workCode,panoIndex:0},F=(l=P.mode)!==null&&l!==void 0?l:L?"Panorama":"Mapview",N={};if(r==="inherit"){F=this.currentMode;var D=(p=(c=S[0])===null||c===void 0?void 0:c.observers)===null||p===void 0?void 0:p[this.panoIndex];D?O={workCode:D.work.workCode,panoIndex:D.panoIndex}:typeof S.initial.panoIndex=="number"?O={workCode:S.initial.work.workCode,panoIndex:S.initial.panoIndex}:(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&(F="Mapview"),N={longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,distance:void 0,offset:void 0}}else if(r==="initial")typeof P.panoIndex=="number"&&(O={workCode:P.work.workCode,panoIndex:P.panoIndex}),P.mode&&(F=P.mode),N={longitude:P.longitude,latitude:P.latitude,fov:P.fov,distance:P.distance,offset:(f=P.offset)===null||f===void 0?void 0:f.clone()};else{if(F=(d=r.mode)!==null&&d!==void 0?d:this.currentMode,typeof r.panoIndex=="number"){var D=S.getObserver({workCode:(m=(h=r.workCode)!==null&&h!==void 0?h:P.work.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex});D&&(O={workCode:D.work.workCode,panoIndex:D.panoIndex})}N={longitude:r.longitude,latitude:r.latitude,fov:r.fov,distance:r.distance,offset:r.offset}}var U=__assign(__assign(__assign({},O),{mode:F}),N),z=this.getCurrentState(),K=(A=v.duration)!==null&&A!==void 0?A:this.modeChangeDuration;(F==="Floorplan"||F==="Topview"||F==="Mapview")&&this.currentMode===F&&(K=0);var j="fly";(F==="Panorama"||F==="VRPanorama"||F==="XRPanorama")&&this.currentMode===F&&(j=(g=v.effect)!==null&&g!==void 0?g:"fade"),this.emit("works.request",createEvent("works.request",{input:e,works:S,state:U,userAction:s}));var Q=function(){u.pano=O;var Y=__assign(__assign({initial:{state:U,currentState:z,duration:K,effect:j,userAction:s}},u.commonParams()),u.controllerInits[F]),G=Controllers[F].initAnimationEndState(Y);if(u.controller&&u.currentMode===F)u.controller.updateWork(S,G,{effect:j,duration:K},s)===!1&&(u.controller.destroy(),u.controller=u.applyController(F,Y));else{var ee=u.currentMode;if(u.controller)u.controller.destroy();else{var te=Controllers[F].initAnimationEndState(Y);u.camera.setFromPose(te),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))}u.controller=u.applyController(F,Y);var ne=createEvent("mode.change",{prevMode:ee,mode:F,state:G,userAction:s});try{u.emit("mode.change",ne)}catch(ae){console.error(ae)}}u.updateTime(u.currentUpdateArgs.time,0,u.currentUpdateArgs.args)};worksMap.set(this,S);var V=Promise.resolve();if(F===t.Mode.Floorplan||F===t.Mode.Topview||F===t.Mode.Mapview||F===t.Mode.Model){this.modelScene.loaded===!1&&(this.camera.setFromPose(U),assignPose(this.state,this.camera.pose)),this.controller||(this.currentMode=F);var J=this.loadModels(S,v);V=Promise.all(J.map(function(Y){return Y.loadedReady})).then(function(){u.needsRender=!0,u.modelSceneNeedsRender=!0,Q(),u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s}))})}else{Q();var W=this.controller,X=!1;this.modelScene.autoRefine=!1;var Z=function(){u.works===S&&X===!1&&(u.needsRender=!0,u.modelSceneNeedsRender=!0,u.emit("camera.update",createEvent("camera.update",{state:u.getCurrentState(),userAction:s})),X=!0,u.modelScene.autoRefine=!0),W.off("pano.arrived",Z),W.off("pano.cancel",Z)},J=this.loadModels(S,v);V=Promise.all(J.map(function(G){return G.initReady})).then(noop),W.once("pano.arrived",Z),W.once("pano.cancel",Z),setTimeout(Z,((y=v.duration)!==null&&y!==void 0?y:this.modeChangeDuration)+1e3)}return this.emit("works.load",createEvent("works.load",{input:e,state:this.getCurrentState(),userAction:s,works:S})),V.then(function(){return u.ready()}).then(function(){var Y;u.emit("works.ready",createEvent("works.ready",{input:e,state:u.getCurrentState(),userAction:s,works:S})),(Y=u.analysis)===null||Y===void 0||Y.work(S)})},t.prototype.reset=function(){var e=this,r=this.loadWorkTask.then(function(){return e.reset_()});return this.loadWorkTask=r.catch(function(o){e.throwError(o)}),r},t.prototype.reset_=function(){var e=this;return new Promise(function(r){var o;e.controller&&(e.controller.destroy(),e.controller=void 0);var s=e.modelScene.parameter;s.pano0&&s.pano0.map.dispose(),s.pano1&&s.pano1.map!==((o=s.pano0)===null||o===void 0?void 0:o.map)&&s.pano1.map.dispose(),s.set({pano0:null,pano1:null,modelAlpha:1}),e.renderer&&e.modelScene.update(e.renderer,e.camera);for(var u=0,l=e.modelScene.children;u<l.length;u++){var c=l[u];c instanceof Model&&(c.dispose(),e.modelScene.remove(c))}e.needsRender=!0,e.modelSceneNeedsRender=!0,worksMap.delete(e);var p=parseWork(null),f=new Model(p);f.work=p,worksMap.set(e,createWorks([p])),e.currentMode="Mapview",e.pano={workCode:"",panoIndex:0},e.camera.setFromPose({distance:0,fov:DEFAULT_CAMERA_FOV,longitude:0,latitude:0,offset:new THREE__namespace.Vector3(0,0,0)}),e.state={mode:e.currentMode,workCode:e.pano.workCode,panoIndex:e.pano.panoIndex,longitude:e.camera.pose.longitude,latitude:e.camera.pose.latitude,fov:e.camera.pose.fov,offset:e.camera.pose.offset.clone(),distance:e.camera.pose.distance},e.camera.needsRender=!1,e.needsRender=!1,e.modelSceneNeedsRender=!1,r()})},t.prototype.changeMode=function(e,r,o,s,u){var l=this;return r===void 0&&(r={}),s===void 0&&(s=!0),u===void 0&&(u=!1),new Promise(function(c,p){var f,d,h,m;if(!l.renderer)throw new Error("renderer is not initialized.");r=__assign({},r);var A=0;l.controller&&(typeof o=="number"?A=o:A=(f=o==null?void 0:o.duration)!==null&&f!==void 0?f:l.modeChangeDuration);var g="fly";l.controller&&typeof o=="object"&&o.effect&&(g=o.effect);var y=typeof r.panoIndex=="number"?{workCode:(m=(d=r.workCode)!==null&&d!==void 0?d:(h=l.work)===null||h===void 0?void 0:h.workCode)!==null&&m!==void 0?m:"",panoIndex:r.panoIndex}:l.pano;if(!t.Mode.hasOwnProperty(e)){var v=new Error('mode "'.concat(e,'" is not existed'));l.throwError(v),p(v);return}if((e===t.Mode.Panorama||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama)&&!l.works.getObserver(y)){var v=new Error("PanoId ".concat(panoStringify(y)," not existed."));l.throwError(v),p(v);return}(e===t.Mode.Floorplan||e===t.Mode.Topview||e===t.Mode.Mapview||e===t.Mode.Model)&&(l.modelScene.loaded||(A=0));var E=l.controller,b=l.currentMode,T=function(){if(l.controller&&l.controller.stopMomentumMovement(),l.controller&&u===!1&&b===e)e===t.Mode.Panorama||e===t.Mode.Model||e===t.Mode.VRPanorama||e===t.Mode.XRPanorama?!panoEqual(l.pano,y)&&"moveToPano"in l.controller&&typeof l.controller.moveToPano=="function"?l.controller.moveToPano(y,__assign({duration:A},r),s):l.controller.updateCamera(r,A,s).catch(noop):(panoEqual(l.pano,y)||(l.pano=y),l.controller.updateCamera(r,A,s).catch(noop));else{var S=__assign(__assign({},r),y),R=__assign(__assign({initial:{state:S,currentState:l.getCurrentState(),duration:A,effect:g,userAction:s}},l.commonParams()),l.controllerInits[e]),w=Controllers[e].initAnimationEndState(R),M=createEvent("mode.change.request",{prevMode:l.currentMode,mode:e,state:w,userAction:s});if(l.emit("mode.change.request",M),!M.defaultPrevented){E&&E.destroy(),l.controller=l.applyController(e,R);var B=createEvent("mode.change",{prevMode:l.currentMode,mode:e,state:w,userAction:s});l.emit("mode.change",B)}}c()};if(e===t.Mode.VRPanorama)l.requestFullscreen(),requestDeviceOrientationPermission().then(function(){return T()}).catch(function(S){var R=S instanceof Error?S:new Error(String(S));l.exitFullscreen(),l.throwError(R),p(R)});else if(e===t.Mode.XRPanorama){var _=AnimationFrameLoop.shared.getContext();_?_.end():requestXRSessionPermission().then(function(S){AnimationFrameLoop.shared.setContext(S),T()}).catch(function(S){var R=S instanceof Error?S:new Error(String(S));l.throwError(R),p(R)})}else T()})},t.prototype.getPixels=function(e,r,o,s,u,l,c){if(!this.renderer)throw new Error("renderer is not initialized.");var p=this.renderer.getPixelRatio(),f=this.renderer.getRenderTarget(),d=this.renderer.getSize(new THREE__namespace.Vector2),h=0,m=0,A=1,g=1,y,v,E,b,T;typeof e=="number"?(h=e,typeof r=="number"&&(m=r),typeof o=="number"&&(A=o),typeof s=="number"&&(g=s),y=u,v=l,T=c):(h=e.x,m=e.y,A=e.width,g=e.height,y=e.pixelRatio,v=e.flipY,E=e.helperVisible,b=e.skipPanorama,T=e.buffer),h=Math.ceil(h),m=Math.ceil(m),A=Math.ceil(A),g=Math.ceil(g),y=Math.ceil(y!=null?y:p),v=v!=null?v:!1;var _=this.helperVisible,S=this.modelScene.parameter.modelAlpha;this.helperVisible=E!=null?E:this.helperVisible,b&&(this.controller instanceof Controllers.Panorama||this.controller instanceof Controllers.VRPanorama||this.controller instanceof Controllers.XRPanorama)&&b===!0&&this.modelScene.parameter.set("modelAlpha",1),this.modelScene.update(this.renderer,this.camera);var R=this.getPixelsRenderTarget;R.setSize(A*y,g*y),this.renderer.setRenderTarget(R),this.camera.pixelRatio=y,this.camera.resolution.set(A,g),this.camera.setViewOffset(d.width,d.height,h,d.height-m-g,A,g),this.scene.update(this.renderer,this.camera),this.render(),this.helperVisible=_,S===void 0?this.modelScene.parameter.reset("modelAlpha"):this.modelScene.parameter.set("modelAlpha",S),this.renderer.setRenderTarget(f),this.camera.clearViewOffset(),this.camera.pixelRatio=p,this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height,this.modelScene.update(this.renderer,this.camera),this.scene.update(this.renderer,this.camera);var w=A*y,M=g*y,B=w*M,C=B*4;if(T){if(T.length!==C)throw new Error("buffer length is not equals pixels ".concat(C))}else T=new Uint8Array(C);if(this.renderer.readRenderTargetPixels(R,0,0,A*y,g*y,T),v)for(var P=B/2,L=0,O=0,F=0,N=0;O<P;O++)for(N=(M-Math.floor(O/w)-1)*w+O%w,F=0;F<4;F++)L=T[O*4+F],T[O*4+F]=T[N*4+F],T[N*4+F]=L;return T},t.prototype.getElement=function(){var e;return(e=this.renderer)===null||e===void 0?void 0:e.domElement},t.prototype.render=function(e){var r=this.renderer;if(r){var o=r.getRenderTarget(),s=r.autoClear,u=r.autoClearColor,l=r.autoClearDepth,c=r.autoClearStencil,p=scratchClearColor.copy(r.getClearColor()),f=r.getClearAlpha(),d=r.getViewport(scratchViewport),h=r.getScissor(scratchScissor),m=r.getScissorTest(),A=r.getSize(scratchRenderSize),g=r.getPixelRatio(),y=Math.floor(A.x*this.viewport.left),v=Math.floor(A.y*this.viewport.bottom),E=Math.floor(A.x*this.viewport.width),b=Math.floor(A.y*this.viewport.height);r.setClearColor(this.backgroundColor,this.backgroundAlpha),r.setViewport(y,v,E,b),r.setScissor(y,v,E,b);var T=this.viewport.bottom!==0||this.viewport.left!==0||this.viewport.width!==1||this.viewport.height!==1;r.setScissorTest(T);var _=this.scene.background;this.modelScene.background=this.camera.isOrthographicCamera?null:_,this.modelScene.environment=this.scene.environment,this.scene.background=null;var S=this.getBuiltinRenderer(r);S.setSize(A.x,A.y,g),this.controller?this.controller.render(S,this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0):S.render(this.onlyRenderIfNeeds?this.modelSceneNeedsRender:!0),this.scene.background=_,this.modelScene.background=null,this.modelScene.environment=null,this.poweredByRealsee&&this.currentMode!=="VRPanorama"&&this.currentMode!=="XRPanorama"&&r.getRenderTarget()!==this.getPixelsRenderTarget&&renderPoweredByRealsee(r),r.setRenderTarget(o),r.autoClear=s,r.autoClearColor=u,r.autoClearDepth=l,r.autoClearStencil=c,r.setClearColor(p,f),r.setViewport(d),r.setScissor(h),r.setScissorTest(m),e&&AnimationFrameLoop.shared.add(e,!0)}},t.prototype.updateTime=function(e,r){for(var o,s=this,u=[],l=2;l<arguments.length;l++)u[l-2]=arguments[l];if(this.currentUpdateArgs={time:e,args:u},!this.destroyed){if(this.renderer&&ktx2.detectSupport(this.renderer),this.syncingState=this.syncState(e,r),this.controller&&(o=this.controller).updateTime.apply(o,__spreadArray([e,r],u,!1)),this.renderer&&(this.camera.pixelRatio=this.renderer.getPixelRatio(),this.getSize(this.camera.resolution),this.camera.aspect=this.camera.resolution.width/this.camera.resolution.height),this.camera.autoNearFar){scratchBox3.makeEmpty(),scratchBox3.expandByObject(this.boundingMesh);var c=scratchBox3.getBoundingSphere(scratchSphere),p=c.radius*2;c.containsPoint(this.camera.position)||(p=this.camera.position.distanceTo(c.center)+c.radius),p=clamp$1(p,800);var f=p/1e4;f=clamp$1(f,.03,.1),this.camera.near!==f&&(this.camera.near=f),this.camera.far!==p&&(this.camera.far=p)}if(this.camera.controllerMode=this.currentMode,this.camera.updateTime(e),this.renderer){var d=this.modelScene.loaded,h=this.modelScene.refined;if(this.modelScene.loaded){for(var m=[],A=0,g=this.modelScene.children;A<g.length;A++){var y=g[A];y instanceof Model&&y.outdated&&m.push(y)}for(var v=0,E=m;v<E.length;v++){var b=E[v];this.modelScene.remove(b),b.dispose()}if(m.length>0)for(var T=0,_=this.modelScene.children;T<_.length;T++){var y=_[T];y instanceof Model&&(y.visible=!0,this.modelSceneNeedsRender=!0)}}this.modelScene.update(this.renderer,this.camera),d===!1&&this.modelScene.loaded===!0&&(this.controller&&this.controller.updateModel(this.modelScene),AnimationFrameLoop.shared.add(function(){s.emit("models.load",createEvent("models.load",{modelScene:s.modelScene}))},!0,0,10)),h===!1&&this.modelScene.refined===!0&&AnimationFrameLoop.shared.add(function(){s.emit("models.refined",createEvent("models.refined",{modelScene:s.modelScene}))},!0,0,10)}this.renderer&&this.scene.update(this.renderer,this.camera),this.syncingState=!1,this.controller&&(this.controller.needsRender===!0&&(this.controller.needsRender=!1,this.needsRender=!0),this.controller.modelSceneNeedsRender===!0&&(this.controller.modelSceneNeedsRender=!1,this.modelSceneNeedsRender=!0)),this.camera.needsRender===!0&&(this.camera.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelScene.needsRender===!0&&(this.modelScene.needsRender=!1,this.needsRender=!0,this.modelSceneNeedsRender=!0),this.scene.needsRender===!0&&(this.scene.needsRender=!1,this.needsRender=!0),this.onlyRenderIfNeeds!==!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0),this.modelSceneNeedsRender===!0&&(this.needsRender=!0);var S=this.camera.resolution.width*this.camera.pixelRatio*this.camera.resolution.height*this.camera.pixelRatio;S>4096*2048?this.renderSwitch01=this.renderSwitch01^1:this.renderSwitch01=0,this.renderSwitch01!==0&&(this.needsRender=!1),this.paused===!0&&(this.needsRender=!1);var R=createEvent("render.prepare",{needsRender:this.needsRender});this.emit("render.prepare",R),R.defaultPrevented&&(this.needsRender=!1);var w=this.needsRender;this.renderer&&w&&this.render(),this.needsRender=!1,this.modelSceneNeedsRender=!1,this.emit("render",createEvent("render",{needsRender:w})),this.hasListener("fps")&&(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 InternalWebGLRenderer&&this.renderer.clear(!0,!0,!0)},t.prototype.play=function(){this.needsRender=!0,this.modelSceneNeedsRender=!0,this.paused=!1},t.prototype.moveToPano=function(e,r,o){r===void 0&&(r={}),o===void 0&&(o=!0);var s=this,u=s.controller,l=s.renderer;if(!u)return this.throwError(new Error("controller is not initialized.")),Promise.resolve();if(!l)return this.throwError(new Error("renderer is not initialized.")),Promise.resolve();var c=this.works.getObserver(e);if(!c)return this.throwError(new Error("pano ".concat(JSON.stringify(e)," not existed."))),Promise.resolve();var p={workCode:c.work.workCode,panoIndex:c.panoIndex};return"moveToPano"in u&&typeof u.moveToPano=="function"?u.moveToPano(p,r,o):c&&(this.pano=p,this.once("initAnimation.start",function(f){r.moveStartCallback&&r.moveStartCallback(f.state)}),this.once("initAnimation.end",function(f){r.moveEndCallback&&r.moveEndCallback(f.state)}),this.changeMode(t.Mode.Panorama,r,{effect:r.effect},o)),this.ready()},t.prototype.preloadPano=function(e,r){var o=this;r===void 0&&(r=noop);var s=this.works.getObserver(e);if(!s)return Promise.reject(new Error("Pano ".concat(JSON.stringify(e)," never found")));var u=["right","left","up","down","front","back"],l=now();return Promise.all(u.map(function(c){var p=panoStringify({panoIndex:s.panoIndex,workCode:s.work.workCode}),f=__assign({key:"pano.".concat(p,".").concat(c)},pick(o.imageOptions,["size","format","quality","forceUseExifOrientation","mappings"])),d=s.work.getURL(s.images[c]),h=o.imageOptions.transform?o.imageOptions.transform(d,f):imageURL(d,f);return getFetcher(s.work).preload(h)})).then(function(){var c=now()-l;return r(c),c})},t.prototype.project2d=function(e,r){if(r===void 0&&(r=!1),!this.renderer)return null;if(r){var o=this.camera.position,s=e.clone().sub(o),u=new THREE__namespace.Raycaster(o,s.clone().normalize());u.params.Points={threshold:.1};var l=this.modelScene.intersectRaycaster(u)[0];if(l&&l.distance+.01<s.length())return null}var c=e.clone().project(this.camera);if(Math.abs(c.z)>1)return null;var p=this.renderer.getSize(new THREE__namespace.Vector2),f=p.x*this.viewport.width,d=p.y*this.viewport.height,h=p.x*this.viewport.left+(c.x+1)/2*f,m=p.y*(1-this.viewport.bottom-this.viewport.height)+(-c.y+1)/2*d;return new THREE__namespace.Vector2(h,m)},t.prototype.getCurrentState=function(){return __assign(__assign({},this.camera.copyPose()),{mode:this.currentMode,workCode:this.pano.workCode,panoIndex:this.pano.panoIndex})},t.prototype.setState=function(e,r,o){var s,u,l,c,p,f,d,h,m,A;r===void 0&&(r=!1),o===void 0&&(o=!0),e=pick(e,["mode","workCode","panoIndex","longitude","latitude","fov","offset","distance"]),e.offset&&!(e instanceof THREE__namespace.Vector3)&&(e.offset=new THREE__namespace.Vector3(e.offset.x,e.offset.y,e.offset.z));var g;if(typeof e.panoIndex=="number")if(e.workCode)g={workCode:e.workCode,panoIndex:e.panoIndex};else{var y=(u=(s=this.work)===null||s===void 0?void 0:s.workCode)!==null&&u!==void 0?u:"",v=this.state.workCode;this.works.filter(function(P){return P.workCode===v}).length>0&&(y=v),g={workCode:y,panoIndex:e.panoIndex}}var E=(l=e.mode)!==null&&l!==void 0?l:this.state.mode,b,T,_,S,R;if(this.controller&&this.controller.stopMomentumMovement(),this.state.mode!==E){if(E==="VRPanorama"){this.changeMode("VRPanorama",void 0,void 0,!0);return}var w={workCode:g==null?void 0:g.workCode,panoIndex:g==null?void 0:g.panoIndex};typeof e.longitude=="number"&&(w.longitude=e.longitude),typeof e.latitude=="number"&&(w.latitude=e.latitude),typeof e.fov=="number"&&(w.fov=e.fov),typeof e.distance=="number"&&(w.distance=e.distance),e.offset instanceof THREE__namespace.Vector3&&(w.offset=e.offset);var M=__assign(__assign({initial:{state:w,currentState:this.getCurrentState(),duration:this.modeChangeDuration,effect:"fly",userAction:!1}},this.commonParams()),this.controllerInits[E]),B=Controllers[E].initAnimationEndState(M);b=B.longitude,T=B.latitude,_=B.fov,S=B.offset,R=B.distance}else b=(c=e.longitude)!==null&&c!==void 0?c:this.state.longitude,T=(p=e.latitude)!==null&&p!==void 0?p:this.state.latitude,_=(f=e.fov)!==null&&f!==void 0?f:this.state.fov,S=(d=e.offset)!==null&&d!==void 0?d:this.state.offset,R=(h=e.distance)!==null&&h!==void 0?h:this.state.distance;var C={workCode:(g!=null?g:this.pano).workCode,panoIndex:(g!=null?g:this.pano).panoIndex,mode:E,longitude:b,latitude:T,fov:_,offset:S,distance:R};this.emit("state.set",createEvent("state.set",{userAction:o,state:C})),stateEqual(this.state,C)||(this.controller&&C.mode==="VRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("VRPanorama")):this.controller&&C.mode==="XRPanorama"&&C.mode!==this.state.mode?(assignState(this.state,C),this.changeMode("XRPanorama")):(assignState(this.state,C),this.controller&&o&&(this.controller.userAction=!1),r&&this.state.mode===C.mode&&(this.syncingState=this.syncState(now(),0,r),this.syncingState&&((m=this.controller)===null||m===void 0||m.updateTime(now(),0),this.syncingState=!1)),this.emit("state.change",createEvent("state.change",{userAction:o,state:this.state})),(A=this.analysis)===null||A===void 0||A.state(this.works,this.state)))},t.prototype.syncState=function(e,r,o){o===void 0&&(o=!1);var s=this.stateSynced;if(this.stateSynced=!1,!this.controller)return!1;if(this.state.mode!==this.currentMode){var u={mode:this.state.mode,workCode:this.state.workCode,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,u,this.modeChangeDuration,this.controller.userAction),!0}if(!this.controller.isReady())return!1;if(this.controller instanceof Controllers.Model){if(notSimilarVector3(this.camera.pose.offset,this.state.offset)){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset};return this.controller.moveToPosition(this.state.offset,__assign(__assign({},l),{duration:o?0:void 0}),!1),!0}}else{var c={workCode:this.state.workCode,panoIndex:this.state.panoIndex};if(!panoEqual(c,this.pano)&&"moveToPano"in this.controller&&typeof this.controller.moveToPano=="function"){var l={longitude:this.state.longitude,latitude:this.state.latitude,fov:this.state.fov,offset:this.state.offset,distance:this.state.distance};return this.controller.moveToPano(c,l,!1),!0}}if(this.controller instanceof Controllers.Floorplan||this.controller instanceof Controllers.Topview||this.controller instanceof Controllers.Mapview){var p=1,f=.2,d=.2,h=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,p),A=Math.abs(this.camera.pose.distance-this.state.distance),g=A>d*15?A/15:f,y=o?this.state.distance:stepNumber(this.camera.pose.distance,this.state.distance,g),v=this.camera.pose.offset.distanceTo(this.state.offset),E=v>d*15?v/15:d,b=o?new THREE__namespace.Vector3().copy(this.state.offset):stepVector(this.camera.pose.offset,this.state.offset,E),T=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},h),_=T.longitude,S=T.latitude;if(notSimilarValue(m,this.camera.pose.fov)||notSimilarVector3(b,this.camera.pose.offset)||notSimilarValue(y,this.camera.pose.distance)||notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)){var R={x:b.x,y:b.y,z:b.z},w={fov:m};return Object.assign(R,{distance:y}),Object.assign(w,{longitude:_,latitude:S}),this.controller.stopMomentumMovement(),this.controller.cameraMotion.set(w,0).catch(noop),this.controller.locationMotion.set(R,0).catch(noop),!0}}else{var M=1,B=Math.PI/45,m=o?this.state.fov:stepNumber(this.camera.pose.fov,this.state.fov,M),C=o?{longitude:this.state.longitude,latitude:this.state.latitude}:stepCoordinates({longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude},{longitude:this.state.longitude,latitude:this.state.latitude},B),_=C.longitude,S=C.latitude,y=this.state.distance,b=new THREE__namespace.Vector3().copy(this.state.offset);if(notSimilarValue(y,this.camera.pose.distance)&&(this.state.distance=this.camera.pose.distance),notSimilarVector3(b,this.camera.pose.offset)&&(this.state.offset=this.camera.pose.offset.clone()),notSimilarValue(_,this.camera.pose.longitude,Math.PI*2)||notSimilarValue(S,this.camera.pose.latitude)||notSimilarValue(m,this.camera.pose.fov))return this.controller.stopMomentumMovement(),this.controller.cameraMotion.set({longitude:_,latitude:S,fov:m},0).catch(noop),!0}if(this.stateSynced=!0,s===!1&&this.emit("state.synced",createEvent("state.synced",{userAction:!1,state:this.state})),this.readyCallbacks.length&&this.stateSynced){var P=this.currentMode,L=P===t.Mode.Floorplan||P===t.Mode.Topview||P===t.Mode.Mapview||P===t.Mode.Model;if(!L||this.modelScene.loaded){var O=this.readyCallbacks.slice();this.readyCallbacks.length=0;for(var F=0,N=O;F<N.length;F++){var D=N[F];this.controller instanceof Controllers.Panorama&&D.tile===!0&&!this.controller.isTileReady()?this.readyCallbacks.push(D):D()}}}return!1},t.prototype.ready=function(e){var r=this;return e===void 0&&(e={}),new Promise(function(o){var s;r.readyCallbacks.push(Object.assign(o,{tile:(s=e.tile)!==null&&s!==void 0?s:!1}))}).then(function(){return r.model.initReady})},t.prototype.requestFullscreen=function(){var e;if(isMobile){var r=(e=this.getElement())===null||e===void 0?void 0:e.parentNode;r&&"requestFullscreen"in r&&typeof document!="undefined"&&document.fullscreenElement===null&&r.requestFullscreen()}},t.prototype.exitFullscreen=function(){typeof document!="undefined"&&document.fullscreenElement&&"exitFullscreen"in document&&document.exitFullscreen()},t.prototype.throwError=function(e){this.hasListener("error")?this.emit("error",e):console.error(e)},t.prototype.loadModels=function(e,r){for(var o=this,s,u,l,c,p,f,d=new Map,h=!1,m=[],A=0,g=this.modelScene.children;A<g.length;A++){var y=g[A];y instanceof Model&&(y.outdated=!0,d.set(y.work.workCode,y),h=!0)}for(var v=function(T){var _=e[T],S=_.workCode&&d.get(_.workCode);if(S)S.work=_,S.outdated=!1,d.delete(_.workCode),m.push(S);else{var R=(l=(u=(s=r.model)===null||s===void 0?void 0:s.textureOptions)!==null&&u!==void 0?u:r.textureOptions)!==null&&l!==void 0?l:E.textureOptions,w=(p=(c=r.model)===null||c===void 0?void 0:c["3d-tiles"])!==null&&p!==void 0?p:r["3d-tiles"],M=new Model(_,{light:(f=r.model)===null||f===void 0?void 0:f.light,textureOptions:R});M.initReady.then(function(){if(w)if(typeof w=="function")for(var O=0,F=M.viewLayers;O<F.length;O++){var N=F[O],D=w(N,M,T);D&&(D.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(D.viewerRequestVolume)),N.parameter.set(omit(D,["showLayers"])),D.showLayers===!1?N.visible=!1:Array.isArray(D.showLayers)&&(N.visible=D.showLayers.includes(N.name)))}else for(var U=0,z=M.viewLayers;U<z.length;U++){var N=z[U];w.viewerRequestVolume&&(N.viewerRequestVolume=makeBoundingVolume(w.viewerRequestVolume)),N.parameter.set(omit(w,["showLayers"])),w.showLayers===!1?N.visible=!1:Array.isArray(w.showLayers)&&(N.visible=w.showLayers.includes(N.name))}}),m.push(M),h&&(M.visible=!1),E.modelScene.add(M);var B=function(){AnimationFrameLoop.shared.add(function(){o.emit("model.load",createEvent("model.load",{work:_,model:M,error:null}))},!0)},C=function(O){var F=O.error;o.emit("model.error",createEvent("model.error",{work:_,model:M,error:F})),o.throwError(F)},P=function(){o.emit("model.changeShownFloor",createEvent("model.changeShownFloor",{work:_,model:M,error:null}))},L=function(){M.removeEventListener("load",B),M.removeEventListener("error",C),M.removeEventListener("changeShownFloor",P),M.removeEventListener("dispose",L)};M.addEventListener("load",B),M.addEventListener("error",C),M.addEventListener("changeShownFloor",P),M.addEventListener("dispose",L),E.emit("model.request",createEvent("model.request",{work:_,model:M,error:null}))}},E=this,b=0;b<e.length;b++)v(b);return this.modelScene.loaded=!1,this.modelScene.refined=!1,m},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,viewport:this.viewport,element:this.getElement(),works:this.works,imageOptions:this.imageOptions,enableWheel:this.enableWheel,extraElements:this.extraElements,videoTexture:this.videoTexture,modelScene:this.modelScene}},t.prototype.applyController=function(e,r){var o=this;if(!this.renderer)throw new Error("renderer is not initialized.");var s=Controllers[e];this.currentMode=e;for(var u=new s(r),l=function(m){u.on(m,function(){for(var A=[],g=0;g<arguments.length;g++)A[g]=arguments[g];var y=o.emit.apply(o,__spreadArray([m],A,!1));if(y)return!1})},c=0,p=PROXY_CONTROLLER_EVENT_NAMES;c<p.length;c++){var f=p[c];l(f)}{var d=Controllers[e].initAnimationEndState(r),h=r.initial.userAction;stateEqual(this.state,d)||(assignState(this.state,d),this.emit("state.change",createEvent("state.change",{userAction:h,state:this.state}))),this.emit("currentState.change",createEvent("currentState.change",{userAction:h,state:this.getCurrentState()}))}return u.on("camera.update",function(m){var A;if(o.controller){var g=o.controller.getTargetState();m.userAction&&o.syncingState===!1&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:m.userAction,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}o.emit("currentState.change",createEvent("currentState.change",{userAction:m.userAction,state:o.getCurrentState()}))}),u.on("initAnimation.start",function(m){var A,g=m.state,y=m.userAction;y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("initAnimation.end",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.arrived",function(m){var A,g=m.state,y=m.userAction;o.pano={workCode:g.workCode,panoIndex:g.panoIndex},y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.cancel",function(m){var A,g=m.state,y=m.userAction;y&&o.state.mode===g.mode&&!stateEqual(o.state,g)&&(assignState(o.state,g),o.emit("state.change",createEvent("state.change",{userAction:y,state:o.state})),(A=o.analysis)===null||A===void 0||A.state(o.works,o.state))}),u.on("pano.moveTo",function(m){var A=m.userAction;o.emit("currentState.change",createEvent("currentState.change",{userAction:A,state:o.getCurrentState()}))}),u.on("pano.request",function(m){o.emit("pano.request",m),m.defaultPrevented||o.moveToPano(m.state,m.options,m.userAction)}),u.on("vr.requestExit",function(){o.currentMode===t.Mode.VRPanorama&&(o.exitFullscreen(),o.changeMode(t.Mode.Panorama))}),u.on("error",function(m){return o.throwError(m)}),u},t.prototype.removeEventListeners=function(){},Object.defineProperty(t.prototype,"internalLightsEnabled",{get:function(){var e=this.scene.children.find(function(r){return r.name==="internalLights"});return e?e.visible:!1},set:function(e){var r=this.scene.children.find(function(o){return o.name==="internalLights"});r&&(r.visible=e),r=this.modelScene.children.find(function(o){return o.name==="internalLights"}),r&&(r.visible=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scissor",{get:function(){return this.viewport},enumerable:!1,configurable:!0}),t.prototype.setScissor=function(e){return this.setViewport(e)},t.prototype.getPose=function(){var e=this.camera.copyPose(),r=e.longitude,o=e.latitude,s=e.fov,u=e.offset,l=e.distance;return{longitude:r,latitude:o,fov:s,offset:u.clone(),distance:l}},t.prototype.getLongitudeAndLatitude=function(){var e=this.getPose(),r=e.longitude,o=e.latitude;return{longitude:r,latitude:o}},t.prototype.getOffset=function(){return this.getPose().offset},t.prototype.getCameraLocal=function(){if(this.pano.workCode&&this.controller&&this.works){var e=this.works.getObserver(this.pano);if(e){var r=new THREE__namespace.Object3D;r.matrix.copy(e.matrix).premultiply(e.work.transform),r.matrix.decompose(r.position,r.quaternion,r.scale),r.matrixAutoUpdate=!1;var o=new THREE__namespace.Vector3(0,0,-1);o.applyQuaternion(this.camera.quaternion);var s=r.quaternion.clone().inverse();o.applyQuaternion(s);var u=Math.atan2(o.x,-o.z),l=-Math.asin(o.y);return{theta:u,phi:l,lookAtVector:o}}}return null},Object.defineProperty(t.prototype,"enableIOSEDR",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableEDL",{get:function(){return this.renderEffect==="edl"},set:function(e){this.renderEffect=e?"edl":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableHQ",{get:function(){return this.renderEffect==="hq"},set:function(e){this.renderEffect=e?"hq":"default"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enablePostProcessing",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),t.Mode={Panorama:"Panorama",Model:"Model",Floorplan:"Floorplan",Topview:"Topview",Mapview:"Mapview",VRPanorama:"VRPanorama",XRPanorama:"XRPanorama"},t})(Subscribe),__FIVE_DEBUG__={constructor:Five,THREE:THREE__namespace,instances:{}};typeof window!="undefined"&&Object.assign(window,{__FIVE_DEBUG__});var XRButton=(function(){function n(){}return n.createButton=function(t){var e=document.createElement("button");function r(){e.style.display="",e.style.cursor="pointer",e.style.left="calc(50% - 50px)",e.style.width="100px",e.textContent="ENTER VR",e.onmouseenter=function(){e.style.opacity="1.0"},e.onmouseleave=function(){e.style.opacity="0.5"},e.onclick=function(){t&&t()}}function o(){e.style.display="",e.style.cursor="auto",e.style.left="calc(50% - 75px)",e.style.width="150px",e.onmouseenter=null,e.onmouseleave=null,e.onclick=null}function s(){o(),e.textContent="VR NOT SUPPORTED"}function u(c){c.style.position="absolute",c.style.bottom="20px",c.style.padding="12px 6px",c.style.border="1px solid #fff",c.style.borderRadius="4px",c.style.background="rgba(0,0,0,0.1)",c.style.color="#fff",c.style.font="normal 13px sans-serif",c.style.textAlign="center",c.style.opacity="0.5",c.style.outline="none",c.style.zIndex="999"}if("xr"in navigator)return e.id="VRButton",e.style.display="none",u(e),navigator.xr.isSessionSupported("immersive-vr").then(function(c){c?r():s()}),e;var l=document.createElement("a");return window.isSecureContext===!1?(l.href=document.location.href.replace(/^http:/,"https:"),l.innerHTML="WEBXR NEEDS HTTPS"):(l.href="https://immersiveweb.dev/",l.innerHTML="WEBXR NOT AVAILABLE"),l.style.left="calc(50% - 90px)",l.style.width="180px",l.style.textDecoration="none",u(l),l},n})();exports.AnimationFrameLoop=AnimationFrameLoop;exports.Camera=Camera;exports.CustomShader=PBMCustomShader;exports.Fetcher=Fetcher;exports.Five=Five;exports.InternalWebGLRenderer=InternalWebGLRenderer;exports.Model=Model;exports.ModelScene=ModelScene;exports.Motion=Motion;exports.NetworkSubscribe=NetworkSubscribe;exports.PBMContainer=PBMContainer;exports.PBMCustomShader=PBMCustomShader;exports.PBMGroup=PBMGroup;exports.PBMMesh=PBMMesh;exports.PBMMeshMaterial=PBMMeshMaterial;exports.PBMPointCloud=PBMPointCloud;exports.PBMPointCloudMaterial=PBMPointCloudMaterial;exports.PBMSkinnedMesh=PBMSkinnedMesh;exports.PROXY_CONTROLLER_EVENT_NAMES=PROXY_CONTROLLER_EVENT_NAMES;exports.PanoCircleMesh=PanoCircleMesh;exports.PanoCircleMeshCustom=PanoCircleMeshCustom;exports.PanoCircleMeshSolid=PanoCircleMeshSolid;exports.Parameter=Parameter;exports.Scene=Scene;exports.Subscribe=Subscribe;exports.TextureLoader=TextureLoader;exports.Tile=Tile;exports.Tile3D=Tile3D;exports.Tile3DModel=Tile3D;exports.TileCache=TileCache;exports.TileNode=TileNode;exports.TileRequestScheduler=TileRequestScheduler;exports.Tileset=Tileset;exports.Trajectory=Trajectory;exports.TrajectoryNode=TrajectoryNode;exports.Work=Work;exports.WorkResolvedObserver=WorkResolvedObserver;exports.XRButton=XRButton;exports.controllersDefaultInitArgs=controllersDefaultInitArgs;exports.coordinatesToVector=coordinatesToVector;exports.createDebugBoundingMesh=createDebugBoundingMesh;exports.createWorks=createWorks;exports.defaultImageURLTransform=imageURL;exports.draco=draco;exports.getViewportScale=getViewportScale;exports.headingToLongitude=headingToLongitude;exports.imageSupport=imageSupport;exports.isBoundingVolume=isBoundingVolume;exports.isPanoId=isPanoId;exports.ktx2=ktx2;exports.loadAt3d=loadAt3d;exports.loadB3dm=loadB3dm;exports.loadDome=loadDome;exports.loadDomez=loadDomez;exports.loadFbx=loadFbx;exports.loadGltf=loadGltf;exports.loadPbm=loadPbm;exports.loadPly=loadPly;exports.loadPnts=loadPnts;exports.loadX3p=loadX3p;exports.longitudeToHeading=longitudeToHeading;exports.makeBoundingVolume=makeBoundingVolume;exports.panoEqual=panoEqual;exports.panoParse=panoParse;exports.panoStringify=panoStringify;exports.parseWork=parseWork;exports.vectorToCoordinates=vectorToCoordinates;exports.workToJson=workToJson;
|