@realsee/five 6.1.4 → 6.1.5
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/five/index.js +4 -4
- package/five/index.mjs +5 -5
- 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/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-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +4 -4
- 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/five/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.1.
|
|
4
|
+
* Generated: 9/20/2024
|
|
5
|
+
* Version: 6.1.5
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -1831,7 +1831,7 @@ void main() {
|
|
|
1831
1831
|
`,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+fp,r=this.getDefines()+hp;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ct([Kt("screenWidth"),Mt("design:type",Number)],t.prototype,"screenWidth",void 0),Ct([Kt("screenHeight"),Mt("design:type",Number)],t.prototype,"screenHeight",void 0),Ct([Kt("edlStrength"),Mt("design:type",Number)],t.prototype,"edlStrength",void 0),Ct([Kt("uNear"),Mt("design:type",Number)],t.prototype,"uNear",void 0),Ct([Kt("uFar"),Mt("design:type",Number)],t.prototype,"uFar",void 0),Ct([Kt("radius"),Mt("design:type",Number)],t.prototype,"radius",void 0),Ct([Kt("neighbours",!0),Mt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ct([Kt("depthMap"),Mt("design:type",d.Texture)],t.prototype,"depthMap",void 0),Ct([Kt("uEDLColor"),Mt("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Ct([Kt("uEDLDepth"),Mt("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Ct([Kt("uProj"),Mt("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Pt(n,t){return{type:n,value:t}}function Kt(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var vp=new d.OrthographicCamera(-1,1,1,-1,0,1),po=new d.BufferGeometry;po.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));po.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var vu=new d.Mesh(po),Au=new d.Scene;Au.add(vu);var Ap=function(n){le(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new pp,vu.material=o.material,o.material.needsUpdate=!0,o}return t.prototype.render=function(e){this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera);var r=this.camera,i=this.material.uniforms,a=this.renderer.getSize(this.sharedV2);i.screenWidth.value=a.x,i.screenHeight.value=a.y;var o=r.projectionMatrix,s=new Float32Array(16);s.set(o.elements);for(var l=new Float32Array(this.material.neighbourCount*2),u=0;u<this.material.neighbourCount;u++)l[2*u+0]=Math.cos(2*u*Math.PI/this.material.neighbourCount),l[2*u+1]=Math.sin(2*u*Math.PI/this.material.neighbourCount);i.neighbours.value=l,i.uNear.value=r.near,i.uFar.value=r.far,i.uEDLColor.value=e[0].texture,i.uProj.value=s,i.edlStrength.value=.25,i.radius.value=1,i.opacity.value=1,this.renderer.setRenderTarget(e[1]),this.renderer.render(Au,vp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(co);const mp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{H{vs|z-nz}yr?Q-drvtuZn}H{vs|z-nz}yr?Q-Qr}uZn}Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1832
1832
|
sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
|
|
1833
1833
|
qvpnqH\frpA-p|y|-J-r\x07r?Q5drvtuZn}9-b6H-p|y|-J-p|y|-<-p|y|;HtylSntP|y|-J-rpA5p|y|;\x07\b 9->;=6H-\f`),gp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=113,i=126,a=0,o="";return t[a].split(o).map(function(s){return s.charCodeAt(a)>i?s:String.fromCharCode((s.charCodeAt(a)+r)%i)}).join(o)}(`}rpvv|{-zrqvz}-sy|nH}rpvv|{-zrqvz}-v{Hnvor-rp@-}|vv|{Hnvor-rp?-H{vs|z-znA-}|wrpv|{Znv\x07H{vs|z-znA-z|qrycvrZnv\x07Hn\bv{t-rp?-bH|vq-znv{56-
|
|
1834
|
-
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var yp=function(n){le(t,n);function t(e){var r=n.call(this,{vertexShader:gp,fragmentShader:mp})||this;return r.uniforms={uDepthMap:Ls("t",null),uWeightMap:Ls("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([Os("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Os("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function Ls(n,t){return{type:n,value:t}}function Os(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var bp=new d.OrthographicCamera(-1,1,1,-1,0,1),vo=new d.BufferGeometry;vo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));vo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var mu=new d.Mesh(vo),gu=new d.Scene;gu.add(mu);var wp=function(n){le(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new yp,o.camera=i,mu.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(gu,bp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(co),Aa=.5,ma=0,xp=function(n){le(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.locationMotion=new Ie({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ie({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Ie({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new Ap(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new wp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return k(k({},c),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",intersectMeshCreator:(u=e.intersectMeshCreator)!==null&&u!==void 0?u:function(){return new ki}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,A=c.models,m=e.initial,h=m.state,v=m.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},p=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,w=fe((s=h.latitude)!==null&&s!==void 0?s:Oa(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,y,c.camera.aspect),x=new d.Vector3,C=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),M=(u=h.longitude)!==null&&u!==void 0?u:Oa(v.mode)?v.longitude:c.defaultLongitude;return h.offset?x.copy(h.offset):c.defaultDistance<b&&p?(x.copy(p.position),h.longitude===void 0&&(M=v.longitude)):x.copy(A.bounding.getCenter(x)),A.bounding.containsPoint(x)||A.bounding.getCenter(x),k(k({},g),{mode:"Mapview",longitude:M,latitude:w,fov:y,offset:x,distance:C})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(z),this.cameraMotion.set(s,i.duration).catch(z),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(z),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.set(c,a/3).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=Gr(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=fe(this.locationMotion.value.x+l.x,this.models.bounding.min.x,this.models.bounding.max.x),m=fe(this.locationMotion.value.y+l.y,this.models.bounding.min.y,this.models.bounding.max.y),h=fe(this.locationMotion.value.z+l.z,this.models.bounding.min.z,this.models.bounding.max.z),v=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:new d.Vector3(A,m,h),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),g=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=X("gesture.momentum",k(k({},e),{isFirst:r,isFinal:g,state:v}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(z),this.locationMotion.set({x:v.offset.x,y:v.offset.y,z:v.offset.z},0).catch(z),g?this.inMomentumMovement=null:pt.shared.add(function(y,w){o.requestMomentumMovement(e,!1,s,w|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Lt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Aa;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}o&&(e.distance=fe(o.distance,ma,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Aa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var A=f.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(u={distance:A,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),c=new d.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=Lt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(p).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var w=this.renderer.getSize(new d.Vector2),b=2*v.x*y/w.y,x=2*v.y*y/w.y,C=new d.Vector3;C.setFromMatrixColumn(this.camera.matrix,0),C.multiplyScalar(-b),g.add(C),this.camera.pose.latitude<Math.PI/9?C.setFromMatrixColumn(this.camera.matrix,1):(C.setFromMatrixColumn(this.camera.matrix,0),C.crossVectors(this.camera.up,C)),C.multiplyScalar(x),g.add(C),g.clamp(this.models.bounding.min,this.models.bounding.max);var M=k(k({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z),e.isFinal&&(this.fixFinalState(M),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z)),e.isFinal){var E=this.renderer.getSize(new d.Vector2),S=2*e.velocityX*y/E.y,I=2*e.velocityY*y/E.y,P=new d.Vector3,R=new d.Vector3;P.setFromMatrixColumn(this.camera.matrix,0),P.multiplyScalar(-S),R.add(P),this.camera.pose.latitude<Math.PI/4?P.setFromMatrixColumn(this.camera.matrix,1):(P.setFromMatrixColumn(this.camera.matrix,0),P.crossVectors(this.camera.up,P)),P.multiplyScalar(I),R.add(P),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:R.x,y:R.y,z:R.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(v),F=Gr(this.cameraMotion.value.longitude+L.longitude),O=fe(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(O=this.cameraMotion.value.latitude);var M=k(k({},this.currentPano),{mode:this.mode,longitude:F,latitude:O,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal&&this.fixFinalState(M),e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(z),e.isFinal){var Q=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,k(k({},this.coordinatesForOffset({x:Q,y:N})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(e.isFinal){delete this.panState,delete this.pinchState;return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=fe(i/e.scale,ma,1/0),l=e.state.offset.clone().sub(Lt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(z),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Aa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=c.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(z)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new d.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=fe(this.locationMotion.value.distance-a,ma,1/0),u=e.state.offset.clone().sub(Lt(e.state).setLength(l)),c=this.models.bounding.containsPoint(u),f=!c&&a<0&&o.distanceTo(u)>s?e.state.distance:l;if(e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:f},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(lo);function Vs(n){return n==null}var Ep={type:"move"},Ns=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ep))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var A=f[c],m=e.getJointPose(A,r);if(u.joints[A.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[A.jointName]=h,u.add(h)}var v=u.joints[A.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}var g=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],y=g.position.distanceTo(p.position),w=.02,b=.005;u.inputState.pinching&&y>w+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=w-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Cp=1,Mp=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("oculus")?c="Oculus":u.includes("pico")?c="Pico":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:z,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:z,this.controllers=[new Ns,new Ns],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],A=(o[8]+1)/o[0],m=s*f,h=s*A,v=i/(-f+A),g=v*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var p=s+v,y=l+v,w=m-g,b=h+(i-g),x=u*l/y*p,C=c*l/y*p;t.projectionMatrix.makePerspective(w,b,x,C,p,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,pt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Cp};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[new XRWebGLLayer(e.session,e.gl,i)]});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),Ao=function(n){le(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(Ao.prototype,{isLineSegmentsGeometry:!0});var ga={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1834
|
+
b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var yp=function(n){le(t,n);function t(e){var r=n.call(this,{vertexShader:gp,fragmentShader:mp})||this;return r.uniforms={uDepthMap:Ls("t",null),uWeightMap:Ls("t",null)},r.depthTest=!0,r.depthWrite=!0,r.opacity=1,r}return t.prototype.getUniform=function(e){return this.uniforms===void 0?void 0:this.uniforms[e].value},t.prototype.setUniform=function(e,r){if(this.uniforms!==void 0){var i=this.uniforms[e];i.value=r}},Ct([Os("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Os("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function Ls(n,t){return{type:n,value:t}}function Os(n,t){return t===void 0&&(t=!1),function(e,r){Object.defineProperty(e,r,{get:function(){return this.getUniform(n)},set:function(i){i!==this.getUniform(n)&&(this.setUniform(n,i),t&&this.updateShaderSource())}})}}var bp=new d.OrthographicCamera(-1,1,1,-1,0,1),vo=new d.BufferGeometry;vo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));vo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var mu=new d.Mesh(vo),gu=new d.Scene;gu.add(mu);var wp=function(n){le(t,n);function t(e,r,i,a){var o=n.call(this,e,r,i,a)||this;return o.sharedV2=new d.Vector2,o.renderer=e,o.material=new yp,o.camera=i,mu.material=o.material,o}return t.prototype.render=function(e){this.models.setMaterial({useHQDepth:!0,useHQWeight:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0,this.renderer.setRenderTarget(e[0]),this.renderer.render(this.scene,this.camera),this.models.setMaterial({useHQWeight:!0,useHQDepth:!1}),this.models.update(this.renderer,this.camera,"Mapview"),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(0),this.renderer.setRenderTarget(e[1]),this.renderer.render(this.scene,this.camera),this.material.uniforms.uWeightMap.value=e[1].texture,this.material.uniforms.uDepthMap.value=e[0].depthTexture,this.renderer.autoClearDepth=!0,this.renderer.autoClearColor=!0,this.renderer.setClearColor(new d.Color(0,0,0)),this.renderer.setClearAlpha(1),this.renderer.setRenderTarget(e[2]),this.renderer.render(gu,bp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(co),Aa=.5,ma=0,xp=function(n){le(t,n);function t(e){var r=this,i,a=t.parseArgs(e);return r=n.call(this,a)||this,r.mode="Mapview",r.defaultLongitude=a.defaultLongitude,r.defaultLatitude=a.defaultLatitude,r.defaultDistance=a.defaultDistance,r.maxLatitude=a.maxLatitude,r.minLatitude=a.minLatitude,r.cameraType=a.cameraType,r.locationMotion=new Ie({x:r.camera.pose.offset.x,y:r.camera.pose.offset.y,z:r.camera.pose.offset.z,distance:r.camera.pose.distance}),r.modelAlphaMotion=new Ie({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Ie({perspToOrtho:r.camera.perspToOrtho.x}),r.intersectMeshCreator=a.intersectMeshCreator,r.intersectMesh=r.intersectMeshCreator(),r.intersectMesh.name="intersect",r.intersectMesh.visible=!1,r.currentTapId=null,r.helper.add(r.intersectMesh),r.edlTarget=new d.WebGLRenderTarget(1024,1024,{minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new Ap(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new wp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u;if(e instanceof t)return e;var c=n.parseArgs.call(this,e);return k(k({},c),{defaultLongitude:(r=e.defaultLongitude)!==null&&r!==void 0?r:Math.PI/4,defaultLatitude:(i=e.defaultLatitude)!==null&&i!==void 0?i:Math.PI/4,defaultDistance:(a=e.defaultDistance)!==null&&a!==void 0?a:150,maxLatitude:(o=e.maxLatitude)!==null&&o!==void 0?o:+Math.PI/2,minLatitude:(s=e.minLatitude)!==null&&s!==void 0?s:0,cameraType:(l=e.cameraType)!==null&&l!==void 0?l:"auto",intersectMeshCreator:(u=e.intersectMeshCreator)!==null&&u!==void 0?u:function(){return new ki}})},t.distanceFromModel=function(e,r,i){var a=e.bounding,o=Math.pow(Math.pow(a.max.x-a.min.x+1,2)+Math.pow(a.max.y-a.min.y+1,2)+Math.pow(a.max.z-a.min.z+1,2),1/2),s=o/2/Math.tan(Math.PI*r/360);return i<1&&(s=s/i),isNaN(s)?o:s},t.initAnimationEndState=function(e){var r,i,a,o,s,l,u,c=this.parseArgs(e),f=c.works,A=c.models,m=e.initial,h=m.state,v=m.currentState,g=typeof h.panoIndex=="number"?{workCode:(a=(r=h.workCode)!==null&&r!==void 0?r:(i=c.works[0])===null||i===void 0?void 0:i.workCode)!==null&&a!==void 0?a:"",panoIndex:h.panoIndex}:{workCode:v.workCode,panoIndex:v.panoIndex},p=f.getResolvedObserver(g),y=(o=h.fov)!==null&&o!==void 0?o:60,w=fe((s=h.latitude)!==null&&s!==void 0?s:Oa(v.mode)?v.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,y,c.camera.aspect),x=new d.Vector3,C=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),M=(u=h.longitude)!==null&&u!==void 0?u:Oa(v.mode)?v.longitude:c.defaultLongitude;return h.offset?x.copy(h.offset):c.defaultDistance<b&&p?(x.copy(p.position),h.longitude===void 0&&(M=v.longitude)):x.copy(A.bounding.getCenter(x)),A.bounding.containsPoint(x)||A.bounding.getCenter(x),k(k({},g),{mode:"Mapview",longitude:M,latitude:w,fov:y,offset:x,distance:C})},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.locationMotion.dispose(),delete this.panState,this.intersectMesh.dispose(),this.helper.remove(this.intersectMesh)},t.prototype.isReady=function(){return this.locationMotion.ended===!1?!1:n.prototype.isReady.call(this)},t.prototype.updateWork=function(e,r,i,a){this.userAction=a,this.works=e;var o=t.initAnimationEndState(k(k({},this),{initial:{currentState:k(k({},this.currentPano),this.camera.pose),duration:i.duration,effect:i.effect,state:r,userAction:a}}));this.currentPano={workCode:o.workCode,panoIndex:o.panoIndex};var s={longitude:o.longitude,latitude:o.latitude,fov:o.fov},l={x:o.offset.x,y:o.offset.y,z:o.offset.z,distance:o.distance,orthoDistance:o.distance};return this.locationMotion.set(l,i.duration).catch(z),this.cameraMotion.set(s,i.duration).catch(z),!0},t.prototype.updateModel=function(e){n.prototype.updateModel.call(this,e)},t.prototype.updateCamera=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();var o={},s={};return e.distance!==void 0&&(o.distance=e.distance),e.offset!==void 0&&(o.x=e.offset.x,o.y=e.offset.y,o.z=e.offset.z),e.longitude!==void 0&&(s.longitude=e.longitude),e.latitude!==void 0&&(s.latitude=e.latitude),e.fov!==void 0&&(s.fov=e.fov),a.locationMotion.set(o,r).catch(z),a.cameraMotion.set(s,r).catch(z)})},t.prototype.updateCameraWithKeyframes=function(e,r,i){var a=this;return this.initAnimationReady.then(function(){a.userAction=i,a.stopMomentumMovement();for(var o=[],s=[],l=0,u=e;l<u.length;l++){var c=u[l];o.push({key:c.key,progress:c.progress,value:{distance:c.value.distance,x:c.value.offset.x,y:c.value.offset.x,z:c.value.offset.x}}),s.push({key:c.key,progress:c.progress,value:{longitude:c.value.longitude,latitude:c.value.latitude,fov:c.value.fov}})}return a.locationMotion.setKeyframes(o,r).catch(z),a.cameraMotion.setKeyframes(e,r)})},t.prototype.updateTime=function(e,r){if(!this.destroyed){var i={},a={};this.locationMotion.ended||(this.locationMotion.update(e),a.distance=this.locationMotion.value.distance,a.offset=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z)),this.cameraMotion.ended||(this.cameraMotion.update(e),a.longitude=this.cameraMotion.value.longitude,a.latitude=this.cameraMotion.value.latitude,a.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended||(this.modelAlphaMotion.update(e),i.modelAlpha=this.modelAlphaMotion.value.modelAlpha);var o=0;this.cameraType==="auto"?o=Math.PI/2-this.cameraMotion.value.latitude<.02?1:0:this.cameraType==="perspective"?o=0:this.cameraType==="orthographic"&&(o=1),this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==o&&this.perspToOrthoMotion.set({perspToOrtho:o},500).catch(z),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Nt(i)||this.models.setMaterial(i),Nt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Me())[1],r=this.locationMotion.getKeyFrameSegment(Me())[1];return k(k({},this.currentPano),{mode:this.mode,longitude:e.value.longitude,latitude:e.value.latitude,fov:e.value.fov,distance:r.value.distance,offset:new d.Vector3(r.value.x,r.value.y,r.value.z)})},t.prototype.initAnimation=function(){var e=this;return this.destroyed?Promise.resolve():new Promise(function(r){var i=e.initial;i.state,i.currentState;var a=i.duration,o=i.userAction;e.userAction=o;var s=t.initAnimationEndState(e),l={longitude:s.longitude,latitude:s.latitude,fov:s.fov},u={x:s.offset.x,y:s.offset.y,z:s.offset.z,distance:s.distance},c={modelAlpha:1},f={perspToOrtho:0};e.emit("initAnimation.start",X("initAnimation.start",{state:s,userAction:e.userAction})),e.perspToOrthoMotion.set(f,a).catch(z),e.modelAlphaMotion.set(c,a/3).catch(z),e.cameraMotion.set(l,a).catch(z),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=k(k(k({},e.currentPano),{mode:e.mode}),_e(e.camera.pose));e.emit("initAnimation.end",X("initAnimation.end",{state:m,userAction:e.userAction}))}).then(function(){r()})})},t.prototype.getForwardObserverOrNot=function(e){var r=this.models.intersectRaycaster(e)[0];if(!r)return null;var i=this.works.resolvedObservers,a=ur(i,function(l){return l.standingPosition.distanceTo(r.point)},!0),o=a[0],s=a[1];return o&&s<10?o:null},t.prototype.coordinatesForOffset=function(e){var r=this.renderer.getSize(new d.Vector2);return{longitude:-2*e.x/(r.x*this.scissor.width),latitude:2*e.y/(r.y*this.scissor.height)}},t.prototype.requestMomentumMovement=function(e,r,i,a){var o=this;if(this.inMomentumMovement!==null){for(var s=k({},i),l={longitude:0,latitude:0,x:0,y:0,z:0},u=0;u<a;u++)s.longitude*=.996,s.latitude*=.996*.998,s.x*=.99,s.y*=.99,s.z*=.99,l.longitude+=s.longitude,l.latitude+=s.latitude,l.x+=s.x,l.y+=s.y,l.z+=s.z;var c=Gr(this.cameraMotion.value.longitude+l.longitude),f=fe(this.cameraMotion.value.latitude+l.latitude,this.minLatitude,this.maxLatitude),A=fe(this.locationMotion.value.x+l.x,this.models.bounding.min.x,this.models.bounding.max.x),m=fe(this.locationMotion.value.y+l.y,this.models.bounding.min.y,this.models.bounding.max.y),h=fe(this.locationMotion.value.z+l.z,this.models.bounding.min.z,this.models.bounding.max.z),v=k(k({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:new d.Vector3(A,m,h),fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),g=!(Math.abs(s.longitude)>1e-4||Math.abs(s.latitude)>1e-4||Math.abs(s.x)>1e-4||Math.abs(s.y)>1e-4||Math.abs(s.z)>1e-4),p=X("gesture.momentum",k(k({},e),{isFirst:r,isFinal:g,state:v}));if(this.inMomentumMovement.event=p,this.emit("gesture.momentum",p),e.defaultPrevented){this.inMomentumMovement=null;return}this.inMomentumMovement&&(this.cameraMotion.set({longitude:c,latitude:f},0).catch(z),this.locationMotion.set({x:v.offset.x,y:v.offset.y,z:v.offset.z},0).catch(z),g?this.inMomentumMovement=null:pt.shared.add(function(y,w){o.requestMomentumMovement(e,!1,s,w|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Lt(e,new d.Vector3),i=new d.Vector3().copy(e.offset).sub(r.clone().multiplyScalar(e.distance)),a=new d.Raycaster(i,r);a.params.Points={threshold:.1},a.near=Aa;var o=this.models.intersectRaycaster(a)[0];if(!o&&a.ray.direction.y<-.3){var s=new d.Plane(new d.Vector3(0,1,0),-this.models.bounding.min.y),l=a.ray.intersectPlane(s,new d.Vector3);if(l){var u=l.distanceTo(a.ray.origin);u<1e4&&u>=a.near&&(o={distance:u,floor:0,point:l,object:this.scene,face:null})}}o&&(e.distance=fe(o.distance,ma,1/0),e.offset.copy(i).add(r.clone().multiplyScalar(e.distance)))}},t.prototype.onPanGesture=function(e){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.pointers.length,i=this.panState,a=0;e.pointerType==="mouse"&&(a=e.srcEvent.buttons),i&&a===0&&i.buttons!==0&&(a=i.buttons);var o=i==null?void 0:i.target;if(!o){var s=this.relativeClientPosition(e.center),l=new d.Raycaster;l.params.Points={threshold:.1},l.setFromCamera(s,this.camera),l.near=Aa,o=new d.Vector3().copy(l.ray.direction).multiplyScalar(3).add(l.ray.origin);var u=this.models.intersectRaycaster(l)[0];if(!u&&l.ray.direction.y<-.3){var c=new d.Plane(new d.Vector3(0,1,0),0),f=l.ray.intersectPlane(c,new d.Vector3);if(f){var A=f.distanceTo(l.ray.origin);A<1e4&&A>=l.near&&(u={distance:A,floor:0,point:f,object:this.scene})}}if(u)o.copy(u.point);else{var m=new d.Vector3().copy(this.camera.pose.offset).sub(this.camera.position),c=new d.Plane().setFromNormalAndCoplanarPoint(m,this.camera.pose.offset);l.ray.intersectPlane(c,o)}}if(e.isFinal?delete this.panState:this.panState={target:o,buttons:a,pointerLength:r,x:e.center.x,y:e.center.y},!(typeof i=="undefined"||i.pointerLength!==r)){var h=r>1||a===2;if(h){var v={x:e.center.x-i.x,y:e.center.y-i.y},g=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),p=Lt(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(g),y=new d.Vector3().copy(p).sub(i.target).length();y*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var w=this.renderer.getSize(new d.Vector2),b=2*v.x*y/w.y,x=2*v.y*y/w.y,C=new d.Vector3;C.setFromMatrixColumn(this.camera.matrix,0),C.multiplyScalar(-b),g.add(C),this.camera.pose.latitude<Math.PI/9?C.setFromMatrixColumn(this.camera.matrix,1):(C.setFromMatrixColumn(this.camera.matrix,0),C.crossVectors(this.camera.up,C)),C.multiplyScalar(x),g.add(C),g.clamp(this.models.bounding.min,this.models.bounding.max);var M=k(k({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:g,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(this.locationMotion.set({x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z),e.isFinal&&(this.fixFinalState(M),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z)),e.isFinal){var E=this.renderer.getSize(new d.Vector2),S=2*e.velocityX*y/E.y,I=2*e.velocityY*y/E.y,P=new d.Vector3,R=new d.Vector3;P.setFromMatrixColumn(this.camera.matrix,0),P.multiplyScalar(-S),R.add(P),this.camera.pose.latitude<Math.PI/4?P.setFromMatrixColumn(this.camera.matrix,1):(P.setFromMatrixColumn(this.camera.matrix,0),P.crossVectors(this.camera.up,P)),P.multiplyScalar(I),R.add(P),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:R.x,y:R.y,z:R.z},0)}}else{var v={x:e.center.x-i.x,y:e.center.y-i.y},L=this.coordinatesForOffset(v),F=Gr(this.cameraMotion.value.longitude+L.longitude),O=fe(this.cameraMotion.value.latitude+L.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(O=this.cameraMotion.value.latitude);var M=k(k({},this.currentPano),{mode:this.mode,longitude:F,latitude:O,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal&&this.fixFinalState(M),e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(z):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(z),e.isFinal){var Q=e.velocityX,N=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,k(k({},this.coordinatesForOffset({x:Q,y:N})),{x:0,y:0,z:0}),0)}}}},t.prototype.onPinchGesture=function(e){var r;if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var i=(r=this.pinchState)===null||r===void 0?void 0:r.distance;if(e.isFirst){this.pinchState={x:e.center.x,y:e.center.y,scale:1,distance:this.locationMotion.value.distance};return}if(e.isFinal){delete this.panState,delete this.pinchState;return}if(typeof i!="undefined"){var a=this.models.bounding.getCenter(new d.Vector3),o=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),s=fe(i/e.scale,ma,1/0),l=e.state.offset.clone().sub(Lt(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;!u&&this.pinchState&&this.pinchState.scale>e.scale&&a.distanceTo(l)>o?c=e.state.distance:(c=s,this.pinchState&&(this.pinchState.scale=e.scale)),e.state.distance=c,this.emit("gesture.pinch",e),!e.defaultPrevented&&(this.locationMotion.set({distance:e.state.distance},0).catch(z),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)))}}},t.prototype.onMouseMove=function(e){var r,i;if(this.intersectMesh.parent&&!this.panState&&!this.pinchState&&!this.mouseWheelState&&(this.emit("gesture.mousemove",e),!e.defaultPrevented)){var a=e.center.raycaster;if(a.near=Aa,a.far=500,e.isFinal&&this.intersectMesh.parent&&this.intersectMesh.visible===!0){this.hideIntersectMesh();return}var o=this.models.intersectRaycaster(a)[0],s=X("intersect.update",{raycaster:a,intersection:o!=null?o:null,object:this.intersectMesh});if(this.emit("intersect.update",s),s.defaultPrevented){this.hideIntersectMesh();return}if(o){var l=(i=(r=o.face)===null||r===void 0?void 0:r.normal)!==null&&i!==void 0?i:new d.Vector3().copy(a.ray.direction).multiplyScalar(-1),u=l.clone(),c=o.point.clone();this.intersectMesh.position.copy(c);var f=c.clone().add(u);if(this.intersectMesh.lookAt(f),Math.abs(l.y)>.99){var A=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(A.z,A.x)}this.intersectMesh.visible=!0,this.needsRender=!0}else this.hideIntersectMesh()}},t.prototype.onMouseWheel=function(e){if(this.initAnimationIsReady)if(this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh(),e.isFinal){var r=e.state;if(this.fixFinalState(r),this.emit("gesture.mousewheel",e),e.defaultPrevented)return;var i={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(i,0).catch(z)}else{var a=e.center.delta/2*Math.max(Math.log(this.locationMotion.value.distance),1),o=this.models.bounding.getCenter(new d.Vector3),s=t.distanceFromModel(this.models,this.cameraMotion.value.fov,this.camera.aspect),l=fe(this.locationMotion.value.distance-a,ma,1/0),u=e.state.offset.clone().sub(Lt(e.state).setLength(l)),c=this.models.bounding.containsPoint(u),f=!c&&a<0&&o.distanceTo(u)>s?e.state.distance:l;if(e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:f},0).catch(z)}},t.prototype.onTapGesture=function(e){var r=this;this.userAction=e.userAction,this.stopMomentumMovement();var i=e.center.raycaster,a=this.getForwardObserverOrNot(i);if(!a)this.emit("gesture.tap",e);else{var o={longitude:this.camera.pose.longitude,latitude:0},s=k(k({},e.state),{mode:"Panorama",workCode:a.pano.workCode,panoIndex:a.pano.panoIndex,longitude:o.longitude,latitude:o.latitude,offset:a?a.position.clone():new d.Vector3,distance:0});if(e.state=s,this.emit("gesture.tap",e),!e.defaultPrevented&&(this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:s,userAction:e.userAction,options:o,progress:0,error:null})),a&&a.active)){var l=this.currentTapId=wt();this.preloadPano(a.pano).then(function(u){r.currentTapId===l&&r.emit("pano.request",X("pano.request",{userAction:!0,prevPano:r.currentPano,progress:0,state:s,options:o,error:null}))})}}},t.prototype.hideIntersectMesh=function(){this.intersectMesh.visible=!1,this.needsRender=!0},t.prototype.render=function(e,r){var i=this.renderer.getRenderTarget();this.updateScreenBuffer(r),e&&(r==="edl"?this.edlEffect.render(this.screenBuffers):r==="hq"?this.hqEffect.render(this.screenBuffers):(this.renderer.setRenderTarget(this.modelRenderTarget),this.renderer.render(this.modelScene,this.camera))),this.depthCopyPass.render(this.modelRenderTarget.depthTexture,i),this.renderer.autoClearDepth=!1,this.renderer.autoClearColor=!0,this.copyPass.render(this.modelRenderTarget,i),this.renderer.setRenderTarget(i),this.renderer.autoClearColor=!1,this.renderer.autoClearDepth=!1,this.renderer.render(this.scene,this.camera),this.renderer.autoClearColor=!0,this.renderer.autoClearDepth=!0},t}(lo);function Vs(n){return n==null}var Ep={type:"move"},Ns=function(){function n(){this._targetRay=null,this._grip=null,this._hand=null,this._axes=[0,0]}return n.prototype.getHandSpace=function(){return this._hand===null&&(this._hand=new d.Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},n.prototype.getTargetRaySpace=function(){return this._targetRay===null&&(this._targetRay=new d.Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new d.Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new d.Vector3),this._targetRay},n.prototype.getGripSpace=function(){return this._grip===null&&(this._grip=new d.Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new d.Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new d.Vector3),this._grip},n.prototype.dispatchEvent=function(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this},n.prototype.disconnect=function(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this},n.prototype.getAxes=function(){return this._axes},n.prototype.update=function(t,e,r){var i=null,a=null,o=null,s=this._targetRay,l=this._grip,u=this._hand;if(t&&t.gamepad&&t.gamepad.axes&&(this._axes=[t.gamepad.axes[2],t.gamepad.axes[3]]),t&&e.session.visibilityState!=="visible-blurred")if(s!==null&&(i=e.getPose(t.targetRaySpace,r),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Ep))),u&&t.hand){o=!0;for(var c=0,f=t.hand.values();c<f.length;c++){var A=f[c],m=e.getJointPose(A,r);if(u.joints[A.jointName]===void 0){var h=new d.Group;h.matrixAutoUpdate=!1,h.visible=!1,u.joints[A.jointName]=h,u.add(h)}var v=u.joints[A.jointName];m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.jointRadius=m.radius),v.visible=m!==null}var g=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],y=g.position.distanceTo(p.position),w=.02,b=.005;u.inputState.pinching&&y>w+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&y<=w-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));return s!==null&&(s.visible=i!==null),l!==null&&(l.visible=a!==null),u!==null&&(u.visible=o!==null),this},n}(),Cp=1,Mp=function(){function n(t,e,r){var i,a,o,s,l;this.isPanorama=(i=r==null?void 0:r.isPanorama)!==null&&i!==void 0?i:!0;var u=navigator.userAgent.toLowerCase(),c;u.includes("pico")?c="Pico":u.includes("oculus")?c="Oculus":c="VP",this.machineType=(a=r==null?void 0:r.machineType)!==null&&a!==void 0?a:c,this.renderer=t,this.gl=e,this.enabled=!1,this.session=null,this.referenceSpaceType=(o=r==null?void 0:r.referenceSpaceType)!==null&&o!==void 0?o:"local-floor",this.referenceSpace=null,this.onSessionStartCallback=(s=r==null?void 0:r.onSessionStart)!==null&&s!==void 0?s:z,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:z,this.controllers=[new Ns,new Ns],this.inputSourcesMap=new Map,this.cameraVR=new d.ArrayCamera,this.cameraL=new d.PerspectiveCamera,this.cameraR=new d.PerspectiveCamera,this.cameraL.viewport=new d.Vector4,this.cameraR.viewport=new d.Vector4,this.cameraL.layers.enable(1),this.cameraR.layers.enable(2),this.cameraVR.layers.enable(1),this.cameraVR.layers.enable(2),this.isPresenting=!1,this.currentDepthNear=null,this.currentDepthFar=null,this.cameraLPos=new d.Vector3,this.cameraRPos=new d.Vector3}return n.prototype.getController=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getRightController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="right"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getLeftController=function(){if(!this.session)return null;var t=this.session.inputSources[0].handedness==="left"?0:1,e=this.controllers[t];return e||console.warn("no controller find"),e.getTargetRaySpace()},n.prototype.getControllerGrip=function(t){var e=this.controllers[t];return e||console.warn("no controller find"),e.getGripSpace()},n.prototype.getCameras=function(){return{cameraL:this.cameraL,cameraR:this.cameraR,cameraVR:this.cameraVR}},n.prototype.updateCamera=function(t,e){e===null?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)},n.prototype.setProjectionFromUnion=function(t,e,r){this.cameraLPos.setFromMatrixPosition(e.matrixWorld),this.cameraRPos.setFromMatrixPosition(r.matrixWorld);var i=this.cameraLPos.distanceTo(this.cameraRPos),a=e.projectionMatrix.elements,o=r.projectionMatrix.elements,s=a[14]/(a[10]-1),l=a[14]/(a[10]+1),u=(a[9]+1)/a[5],c=(a[9]-1)/a[5],f=(a[8]-1)/a[0],A=(o[8]+1)/o[0],m=s*f,h=s*A,v=i/(-f+A),g=v*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(g),t.translateZ(v),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var p=s+v,y=l+v,w=m-g,b=h+(i-g),x=u*l/y*p,C=c*l/y*p;t.projectionMatrix.makePerspective(w,b,x,C,p,y)},n.prototype.getCamera=function(t){this.cameraVR.near=this.cameraR.near=this.cameraL.near=t.near,this.cameraVR.far=this.cameraR.far=this.cameraL.far=t.far,this.session&&(this.currentDepthNear!==this.cameraVR.near||this.currentDepthFar!==this.cameraVR.far)&&(this.session.updateRenderState({depthNear:this.cameraVR.near,depthFar:this.cameraVR.far}),this.currentDepthNear=this.cameraVR.near,this.currentDepthFar=this.cameraVR.far);var e=t.parent,r=this.cameraVR.cameras;this.updateCamera(this.cameraVR,e);for(var i=0;i<r.length;i++)this.updateCamera(r[i],e);t.matrixWorld.copy(this.cameraVR.matrixWorld);for(var a=t.children,i=0,o=a.length;i<o;i++)a[i].updateMatrixWorld(!0);return r.length===2?this.setProjectionFromUnion(this.cameraVR,this.cameraL,this.cameraR):this.cameraVR.projectionMatrix.copy(this.cameraL.projectionMatrix),this.cameraVR},n.prototype.updateInputSources=function(t){if(!this.session){console.warn("session is lose!");return}for(var e=this.session.inputSources,r=0;r<this.controllers.length;r++)this.inputSourcesMap.set(e[r],this.controllers[r]);for(var r=0;r<t.removed.length;r++){var i=t.removed[r],a=this.inputSourcesMap.get(i);a&&(a.dispatchEvent({type:"disconnected",data:i}),this.inputSourcesMap.delete(i))}for(var r=0;r<t.added.length;r++){var i=t.added[r],a=this.inputSourcesMap.get(i);a&&a.dispatchEvent({type:"connected",data:i})}},n.prototype.onSessionEvent=function(t){var e=this.inputSourcesMap.get(t.inputSource);e&&e.dispatchEvent({type:t.type})},n.prototype.onSessionEnd=function(){this.inputSourcesMap.forEach(function(t,e){t.disconnect(e)}),this.inputSourcesMap.clear(),this.renderer.setFramebuffer(null),this.renderer.setRenderTarget(this.renderer.getRenderTarget()),this.isPresenting=!1,this.session=null,pt.shared.setContext(null),this.onSessionEndCallback()},n.prototype.onRequestReferenceSpace=function(t){this.referenceSpace=t,this.isPresenting=!0,this.session&&this.onSessionStartCallback(this.session)},n.prototype.setSession=function(t){var e=this;if(this.session=t,this.session){this.session.addEventListener("select",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectstart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("selectend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeeze",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezestart",function(i){e.onSessionEvent(i)}),this.session.addEventListener("squeezeend",function(i){e.onSessionEvent(i)}),this.session.addEventListener("end",function(i){e.onSessionEnd()});var r=this.gl.getContextAttributes();this.gl.makeXRCompatible().then(function(){var i={antialias:r==null?void 0:r.antialias,alpha:r==null?void 0:r.alpha,depth:r==null?void 0:r.depth,stencil:r==null?void 0:r.stencil,framebufferScaleFactor:Cp};if(!e.session){console.error("session is lose while set session!");return}switch(e.machineType){case"Pico":case"VP":e.session.updateRenderState({baseLayer:new XRWebGLLayer(e.session,e.gl,i)});break;case"Oculus":e.session.updateRenderState({layers:[new XRWebGLLayer(e.session,e.gl,i)]});break;default:e.machineType;break}e.session.requestReferenceSpace(e.referenceSpaceType).then(function(a){e.onRequestReferenceSpace(a)}),e.session.addEventListener("inputsourceschange",function(a){e.updateInputSources(a)})})}},n}(),Ao=function(n){le(t,n);function t(){var e=n.call(this)||this;e.type="LineSegmentsGeometry";var r=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],a=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];return e.setIndex(a),e.setAttribute("position",new d.Float32BufferAttribute(r,3)),e.setAttribute("uv",new d.Float32BufferAttribute(i,2)),e}return t.prototype.applyMatrix4=function(e){var r=this.attributes.instanceStart,i=this.attributes.instanceEnd;return r!==void 0&&(r.applyMatrix4(e),i.applyMatrix4(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this},t.prototype.setPositions=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceEnd",new d.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},t.prototype.setColors=function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)?r=new Float32Array(e):r=new Float32Array;var i=new d.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new d.InterleavedBufferAttribute(i,3,0)),this.setAttribute("instanceColorEnd",new d.InterleavedBufferAttribute(i,3,3)),this},t.prototype.fromWireframeGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromEdgesGeometry=function(e){return this.setPositions(e.attributes.position.array),this},t.prototype.fromMesh=function(e){return this.fromWireframeGeometry(new d.WireframeGeometry(e.geometry)),this},t.prototype.fromLineSegments=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.computeBoundingBox=function(){this.boundingBox===null&&(this.boundingBox=new d.Box3);var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=new d.Box3;this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(r),this.boundingBox.union(i)}},t.prototype.computeBoundingSphere=function(){this.boundingSphere===null&&(this.boundingSphere=new d.Sphere),this.boundingBox===null&&this.computeBoundingBox();var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;if(e!==void 0&&r!==void 0){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var a=0,o=new d.Vector3,s=0,l=e.count;s<l;s++)o.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(o)),o.fromBufferAttribute(r,s),a=Math.max(a,i.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}},t.prototype.toJSON=function(){},t}(d.InstancedBufferGeometry);Object.assign(Ao.prototype,{isLineSegmentsGeometry:!0});var ga={uniforms:d.UniformsUtils.merge([d.UniformsLib.common,d.UniformsLib.fog,{linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}}]),vertexShader:`
|
|
1835
1835
|
#include <common>
|
|
1836
1836
|
#include <color_pars_vertex>
|
|
1837
1837
|
#include <fog_pars_vertex>
|
|
@@ -2030,7 +2030,7 @@ void main() {
|
|
|
2030
2030
|
#include <premultiplied_alpha_fragment>
|
|
2031
2031
|
|
|
2032
2032
|
}
|
|
2033
|
-
`},mo=function(n){le(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ga.uniforms),vertexShader:ga.vertexShader,fragmentShader:ga.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(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(mo.prototype,{isLineMaterial:!0});var yu=function(n){le(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Ao,i.material=r!==void 0?r:new mo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,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 i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,A=s.attributes.instanceEnd,m=new d.Vector4,h=new d.Vector4,v=new d.Vector4,g=new d.Vector3,p=new d.Matrix4,y=new d.Line3,w=new d.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=u.x/2,v.y*=u.y/2,v.z=0,g.copy(v);var b=this.matrixWorld;p.multiplyMatrices(a.matrixWorldInverse,b);for(var x=0,C=f.count;x<C;x++){m.fromBufferAttribute(f,x),h.fromBufferAttribute(A,x),m.w=1,h.w=1,m.applyMatrix4(p),h.applyMatrix4(p),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var M=m.z<-1&&h.z<-1,E=m.z>1&&h.z>1;if(!(M||E)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(m),y.start.z=0,y.end.copy(h),y.end.z=0;var S=y.closestPointToPointParameter(g,!0);y.at(S,w);var I=d.MathUtils.lerp(m.z,h.z,S),P=I>=-1&&I<=1,R=g.distanceTo(w)<c*.5;if(P&&R){y.start.fromBufferAttribute(f,x),y.end.fromBufferAttribute(A,x),y.start.applyMatrix4(b),y.end.applyMatrix4(b);var L=new d.Vector3,F=new d.Vector3;i.distanceSqToSegment(y.start,y.end,F,L),r.push({point:F,pointOnLine:L,distance:i.origin.distanceTo(F),object:this,faceIndex:x})}}}},t}(d.Mesh);Object.assign(yu.prototype,{isLineSegments2:!0});var bu=function(n){le(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(yu);Object.assign(bu.prototype,{isLine2:!0});var wu=function(n){le(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,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Ao);Object.assign(wu.prototype,{isLineGeometry:!0});var Ip="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8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8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Qs=14467195,Sp=8,Tp=2,Pp=20,zs=null,Da=function(n){le(t,n);function t(e,r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new wu,o=new mo({color:Qs,linewidth:Tp,dashScale:Pp,dashed:!1});i.line=new bu(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:Qs,size:Sp,map:zs||(zs=new d.TextureLoader().load(Ip)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.1.4"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(Da.prototype,{isFiveLine:!0});var Xe={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function xu(n){return Pi(this,void 0,void 0,function(){var t;return Bi(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 Bp(n){return Pi(this,void 0,void 0,function(){var t,e;return Bi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,xu("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Rp(n,t){return Pi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Bi(this,function(A){switch(A.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Bp(r)];case 1:if(o=A.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,xu(s.profilePath)];case 2:if(u=A.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Fp={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function kp(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Lp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Fp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=kp(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Op=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(i){var a=new Lp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.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=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Xe.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=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Vp=function(){function n(t,e,r){var i=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(a){var o=i.layoutDescription.components[a];i.components[a]=new Op(a,o)}),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}(),Np="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Qp="generic-trigger",zp=function(n){le(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(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.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(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Xe.VisualResponseProperty.VISIBILITY?a.visible=l:u===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Ln.Object3D);function Dp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Ln.SphereGeometry(.001),s=new Ln.MeshBasicMaterial({color:255}),l=new Ln.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,A=u.maxNodeName,m=u.valueNodeProperty;if(m===Xe.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(A),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(A," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function Ds(n,t){Dp(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Up=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Np,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new zp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Rp(o,e.path,Qp).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Vp(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),Ds(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),Ds(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function qp(n,t){return n}var Us=300,Hp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),qs=new d.Vector3(-1,1,1),Gp=function(n){le(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Mp(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",X("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new Da,right:new Da},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Up;o.gltfLoader={load:function(l,u){gi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return $a(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:gi})}).then(function(c){return u(c)})}},(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=wt()]={panoId:Ue(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=pt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),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=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var A=qn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=function(P,R){return qp(yi(P,h,R))},g=k({key:"pano.".concat(f.panoId)},Er(this.imageOptions,["format","size","quality"])),p=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(P){return P.size>m}))!==null&&l!==void 0?l:null,w="pano:"+zn([p,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===w)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var x=this.models.getMaterial()||{},C=x.pano0,M=x.pano1,E;if((C==null?void 0:C.map.name)===w?E=C:(M==null?void 0:M.map.name)===w&&(E=M),E){var S={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:E.map,luminanceMap:E.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,qs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,S,r);return}var I="move-to-pano-"+f.panoId;this.pending.add(I),this.pendingTextureTask={panoId:f.panoId,hash:w,onLoad:function(P){if(a.pending.delete(I),a.destroyed)P.body.dispose();else{P.body.name=w;var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,qs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,R,r)}},onError:function(P){a.pending.delete(I);var R=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",X("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:R})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:R})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(p,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(P){var R,L;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:P,meta:null,pano:f.pano})),((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(p,{imageURL:{transform:v,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(P){var R,L;((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(P)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:P,meta:null,pano:f.pano}))},this.renderer)]).then(function(P){var R,L,F=P[0];((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w?(a.pendingTextureTask.onLoad(F),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:F.meta,pano:f.pano}))):F.body.dispose()}).catch(function(P){var R,L;((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&(a.pendingTextureTask.onError(P),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:P,progress:0,meta:null,pano:f.pano})),a.emit("error",P))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,A,m,h,v;i===void 0&&(i={});var g=Me(),p=wt();this.panoResources[p]=r;var y=1,w,b,x;if(this.locationMotion.ended){var C=this.locationMotion.getKeyFrameSegment(g);C[0];var M=C[1],E=this.locationMotion.value,S=this.panoResourceFromLocationMotionKeyframe(M).position,I=r.position;w=Math.max(S.distanceTo(I),y),b=[{key:M.key,progress:0,value:k(k({},E),{count:0})},{key:p,progress:1,value:{distance:0,count:1}}],x=0}else{var P=this.locationMotion.getKeyFrameSegment(g),R=P[0],M=P[1],E=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(R).position,S=this.panoResourceFromLocationMotionKeyframe(M).position,I=r.position,F=M.value.count-E.count,O=Math.max(L.distanceTo(S),y)*F,Q=Math.max(S.distanceTo(I),y);w=O+Q,b=[{key:R.key,progress:0,value:k({},E)},{key:M.key,progress:O/w,value:M.value},{key:p,progress:1,value:{count:M.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),W=this.locationMotionKeyframesLength(b);x=this.locationMotion.getProgressVelocity(g)*N/W}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?w:0),D={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=k(k({},e),{mode:this.mode,longitude:(o=D.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=D.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=D.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:J,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),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=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(D,K).catch(z);else{var H=Lt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),j=Lt({longitude:(u=D.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=D.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Y=new d.Object3D;Y.lookAt(H);var _=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(j);var pe=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion),ee=new d.Matrix4().getInverse(_).premultiply(pe),oe=this.cameraMotion.value.fov,ie=(f=D.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ce=1;r.effect==="zoomin"?ce=1.5:r.effect==="zoomout"&&(ce=.4);for(var ne=ie*ce,ae=0;ae<b.length-1;ae++){var he=b[ae].key;if(he){var ve=this.panoResources[he];ve&&(ve.fixCameraTransform.copy(ee),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(ne/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:(A=D.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=D.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(h=D.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=D.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ie}}],K).catch(z)}var we=this.locationMotion.setKeyframes(b,K,x);we.then(function(){for(var Ce,Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:J,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Se=a.works.getResolvedObserver(a.currentPano);if(Se&&Se.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var De=Hp.clone().multiply(($=(Be=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new d.Matrix4).multiply(Se.video.matrix),ye={map:a.videoTexture,size:Se.video.size,matrix:De,alpha:1},be=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",be),cu().then(function(me){me&&Se.video&&ge.getAttribute("uuid")===be&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(ye))},ge.src=Se.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(j){var Y=ht(j);if(Wt(Y,r.currentPano))return!1;var _=r.works.getResolvedObserver(Y);return!_||_.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:_.loadable||_.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=ur(f,function(j){var Y=r.works.getResolvedObserver(j);if(!Y)return 1/0;var _=Y.standingPosition.clone();return _.distanceTo(A.point)},!0),h=m[0],v=m[1];h&&v<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(Vs(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var p=0,y=this.locationMotion.keyframes;p<y.length;p++){var w=y[p],b=this.panoResourceFromLocationMotionKeyframe(w);if(!(w.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(Vs(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var x=u.panoId;this.panoMeshes[x]&&(this.panoMeshes[x].setDisabled(!1),this.panoMeshes[x].setLoading(!0))}var C={};if(u){for(var M=Math.PI/6,E=Math.PI/12,S=new d.Vector3(0,1,0),I=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),P=I.clone().applyAxisAngle(S,M),R=I.clone().applyAxisAngle(S,-M),L=[],F=[],O=[],Q=0,N=u.accessibleIds;Q<N.length;Q++){var h=N[Q],W=ht(h);if(!(Wt(W,this.currentPano)||Wt(W,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var D=K.position.clone().sub(u.position).setY(0);I.angleTo(D)<M?O.push(D):P.angleTo(D)<M?L.push(D):R.angleTo(D)<M&&F.push(D)}}}var G=O.length>0?O:yt(yt([],L,!0),F,!0),J=G.slice().sort(function(j,Y){return j.angleTo(I)-Y.angleTo(I)})[0];J&&J.angleTo(l)>E&&(C.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(C.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(C.fov=this.defaultFov);var H={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=C.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=C.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=C.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:H,userAction:!0,options:C,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:H,options:C,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,A,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var v={},g={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),w=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),x=b[0],C=b[1],M=this.panoResourceFromLocationMotionKeyframe(x),E=this.panoResourceFromLocationMotionKeyframe(C),S=new d.Vector3().copy(M.position),I=new d.Vector3().copy(E.position),P=this.locationMotion.value.count-C.value.count+1;v.progress=P,E.leftPanoPicture&&(P<1?M.leftPanoPicture&&(v.pano0=M.leftPanoPicture):v.pano0=E.leftPanoPicture,v.pano1=E.leftPanoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(P,3)),P<1&&E.effect!=="fly"&&(v.pano0&&M.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(E.position)}),S.copy(I),w=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(S.x+(I.x-S.x)*P,S.y+(I.y-S.y)*P,S.z+(I.z-S.z)*P);for(var R=[],L=[],F=0,O=this.locationMotion.keyframes;F<O.length;F++){var Q=O[F],N=Q.key,W=Q.progress;N!==void 0&&(R.push(N),W>this.locationMotion.progress&&L.push(N))}for(var K=0,D=Object.keys(this.panoResources);K<D.length;K++){var G=D[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.leftPanoPicture){var H=J.leftPanoPicture.map;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof Qe&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),J.leftPanoPicture=null}}R.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=ht(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:ht(p.panoId),state:k(k(k(k({},ht(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof Qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof Qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(g)===!1&&this.setCamera(g);var j=this.works.getResolvedObserver(this.currentPano),Y=m[1];if(!Y){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var _=this.xrManager.referenceSpace;if(_){var pe=this.xrManager.cameraVR,ee=this.xrManager.cameraL,oe=this.xrManager.cameraR,ie=[ee,oe],ce=Y.getViewerPose(_),ne=new d.Vector3(0,0,0);if(ce){var ae;ae=this.xrManager.session.renderState.baseLayer;var he=ce.views;if(!ae){console.error("no layer found");return}this.renderer.setFramebuffer(ae.framebuffer);var ve=!1;he.length!==pe.cameras.length&&(pe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var we=new d.Vector3,Ce=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(we,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(he[1].transform.matrix).decompose(Ce,new d.Quaternion,new d.Vector3),Ce.clone().sub(we).normalize();var Be=new d.Vector3,$=new d.Quaternion,te=new d.Vector3;this.camera.matrix.decompose(Be,$,te);for(var U=0;U<he.length;U++){var Le=he[U],Pe=ae.getViewport(Le),Se=ie[U];Se.matrix.fromArray(Le.transform.matrix);var De=new d.Vector3,ye=new d.Quaternion,be=new d.Vector3;Se.matrix.decompose(De,ye,be),ne.copy(Be),Se.position.copy(Be),Se.quaternion.copy(ye),Se.scale.copy(be),Se.updateMatrix(),Se.projectionMatrix.fromArray(Le.projectionMatrix),Se.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ve===!0&&pe.cameras.push(Se)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var U=0;U<this.xrManager.session.inputSources.length;U++)if(this.xrManager.session.inputSources[U]&&this.xrManager.session.inputSources[U].targetRayMode==="transient-pointer"){var ge=Y.getPose(this.xrManager.session.inputSources[U].targetRaySpace,_);if(ge){var me=new d.Vector3(0,0,-1).applyQuaternion(ge.transform.orientation),Ae=new d.Raycaster(this.camera.position,me);this.gazeRay=Ae}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ne=this.xrManager.session.inputSources,U=0;U<Ne.length;U++){var ze=this.xrManager.controllers[U],je=Ne[U];if(je){ze&&ze.update(je,Y,_);var Ae=this.xrManager.getController(U),cr=new d.Vector3(0,1.2,0),ke=Ae.position.clone().add(ne).sub(cr);je.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(Ae.rotation)):je.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(Ae.rotation)),this.controllerWrappers[U].position.copy(new d.Vector3(0,0,0).add(ne).sub(cr));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Jr;return k({floor:(Jr=j==null?void 0:j.floorIndex)!==null&&Jr!==void 0?Jr:0},Ir)})),Ye.length>=1&&Ye[0].face)if(je.handedness==="right"){var xt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Zt=Ye[0].face.normal,nn=Zt.clone(),Yt=Ye[0].point.clone();this.intersectMesh.position.copy(Yt);var St=Yt.clone().add(nn);if(this.intersectMesh.lookAt(St),Math.abs(Zt.y)>.99){var $t=this.camera.position.clone().sub(Yt);this.intersectMesh.rotation.z=-Math.atan2($t.z,$t.x)}this.intersectMesh.visible=!0,this.needsRender=!0,xt.length>0?(this.pointerLines.right.setPoints(ke,xt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ye[0].point));var Cr=Ye[0],Qt=X("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Cr!=null?Cr:null,object:this.intersectMesh});if(this.emit("intersect.update",Qt),Qt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ye[0].point)}}this.updateControllerHelper(Ne,e,r)}if(this.camera.pose.distance>.1||w)for(var er=0,zt=Object.keys(this.panoMeshes);er<zt.length;er++){var ut=zt[er],Oe=this.panoMeshes[ut];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(j){var dr=ur(j.visibleIds,function(lt){var qt=i.works.getResolvedObserver(lt);return qt?j.standingPosition.distanceTo(qt.standingPosition):1/0},!0),vt=dr[1];vt=fe(vt,2.5,1/0);for(var fr=j.visibleIds.concat(Ue(this.currentPano)),hr=this.getForwardObserverOrNot(),Dt=this.camera.getDirection(new d.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var ut=pr[Et],Oe=this.panoMeshes[ut],Mr=this.works.getResolvedObserver(ut);if(fr.indexOf(ut)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Mr)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Mr.loadable&&!Mr.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var an=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&hr!==null&&hr.panoId===ut),Oe.setOpacity(an<.01?0:fe(vt/an*1.2,.65,.98));var Kr=this.camera.position.clone().setY(Oe.position.y),me=new d.Vector3().copy(Oe.position).sub(Kr).normalize();if(ut===Ue(this.currentPano)){var jr=fe((.5-Kr.distanceTo(Oe.position))/.5,0,1);me.multiplyScalar(1-jr).add(Dt.clone().multiplyScalar(jr))}me.length()>0&&Oe.quaternion.setFromEuler(new d.Euler(0,Math.atan2(me.x,me.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Ut=function(){return 4}(),et=function(){var lt=new d.PerspectiveCamera;lt.applyMatrix4(pe.matrix),lt.position.set(0,0,0);var qt=i.works.getResolvedObserver(y.panoId),Ir=qt!=null?qt:j;Ir&<.quaternion.premultiply(Ir.quaternion.clone().inverse()),lt.updateProjectionMatrix(),lt.updateMatrixWorld(!0);var Jr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(lt.projectionMatrix,lt.matrixWorldInverse));return Jr}();y.panoId===Ue(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Qe&&(y.leftPanoPicture.map.update(et,Ut),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var Ge=this.tiling.object.visible;if(Ut>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var nt=y.panoId,At=this.works.getResolvedObserver(nt);At?Wn(this.camera.position,At.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((A=(f=At.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&At.images.luminance?At.images.luminance:null),this.tiling.setFetcher(it(At.work)),this.tiling.setRotation(At.quaternion),this.tiling.setPosition(At.position),this.tiling.update(et,Ut,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ge!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);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,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var A={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=A,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>Us&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=Us){var l=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.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}(ho),Bt={Floorplan:za,Topview:Ah,Panorama:ho,VRPanorama:lp,Model:dp,Mapview:xp,XRPanorama:Gp},Eu=["gesture.pan","gesture.tap","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 Kp(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.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=Lt(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 jp(){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 Hs(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function Jp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function Cu(){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 i=Jp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Xp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5C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SQ1EQRjHGdzdHTa4u7tzBs7CedhykNwF2/5jq56iU11db6Lv2yTj8hs3JoiU9sZZp5/62J5v1z9NjrDHaSbnbFMf52sHrDUVaidDxNG0o9+uLjfosfdb3jT5d5j757riJgst9NIZQ2Pn+ySZll80vjI6Wz/hQJG4vPG0L/H6poQch/dW3vL3B0u8jl0HvVj5PvHCElEF8DUAFikVYTcvmfBdDzQlvvMXSV5lP5zrXj/fJ54zuWaeeuoqkW8AwCIaqeTZKkmYrpPwR2eqN9X72W7EG57vU67OBeuMV8KXLUzv93UTTj42tvaFS++GVsc5JRyLSLJ8nzO555hFBmiSRCqMr4GwrcmGkib5xSvcwmzFK6e8s7DMa2xH4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Gs=[351,63],Ks=[20,20],Wp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_p=new Float32Array([0,0,1,0,0,1,1,1]),Zp=new Uint8Array([0,1,2,1,3,2]),Vi=new d.BufferGeometry;Vi.setAttribute("position",new d.BufferAttribute(Wp,3));Vi.setAttribute("uv",new d.BufferAttribute(_p,2));Vi.setIndex(new d.BufferAttribute(Zp,1));var Ai=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Mu=new d.Mesh(Vi,Ai);Mu.matrixAutoUpdate=!1;var go=new d.Scene;go.add(Mu);go.matrixAutoUpdate=!1;var _n=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);_n.position.set(0,0,.5);_n.lookAt(0,0,0);_n.updateMatrixWorld(!0);_n.matrixAutoUpdate=!1;var Yp=new d.Vector4,$p=new d.Vector4;function ev(n){if(Ai.map){var r=n.getViewport(Yp),i=n.getScissor($p),a=n.getScissorTest(),o=n.autoClear,s=i.x+Ks[0]/3,l=i.y+Ks[1]/3,u=Gs[0]/3,c=Gs[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(go,_n),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ai.needsUpdate=!0,e.onload=z},e.src=Xp,Ai.map=t}}var tv=800,js=90,rv=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/")},nv=new d.Vector2,si=new d.Frustum,ui=new d.Matrix4,Js=new WeakMap,ya=new WeakMap,Xs=La([]),Iu=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,A,m,h=n.call(this)||this;if(h.ident=wt(),typeof window!="undefined"&&(Ua.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.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)},h.fps={testCount:0,testTime:Me()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:tv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof _r&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new _r({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var v=Cu();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(I){I instanceof Error&&h.throwError(I)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding});var g=new d.DepthTexture(1,1);g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(A=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&A!==void 0?A:d.sRGBEncoding,depthTexture:g,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Fi(js),h.scene=new p0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:rv,h.networkSubscribe=new r0,h.networkSubscribe.on("network",function(I,P,R,L){var F;h.emit("network.resource",X("network.resource",{source:I,requestType:P,requestState:R,detail:L})),(F=h.analysis)===null||F===void 0||F.network(h.works,I,P,R,L)}),h.boundingMesh=eh(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=gs(),h.models.push(new Va),h.lastModels=gs(),h.lastWorks=La([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||jp()),Hs(h.scene),Hs(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=pt.shared.add(function(I,P){for(var R=[],L=2;L<arguments.length;L++)R[L-2]=arguments[L];h.updateTime.apply(h,yt([I,P],R,!1))},!1,0,10));var p=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var w=0,b=e.plugins;w<b.length;w++){var x=b[w];if(typeof x=="function")x(h);else if(Array.isArray(x)){var C=x[0],M=x[1],E=x[2];if(typeof C=="function"){var S=C(h,E);typeof M=="string"&&(h.plugins[M]?h.throwError(new Error("plugin name ".concat(M," is exists."))):h.plugins[M]=S)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,Kp(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.1.4"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Ci.decoderPath},set:function(e){Ci.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Qn.transcoderPath},set:function(e){Qn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof It)){var A=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(A)if(s.meshOriginMaterialMap.set(A,f.material),s.meshReplaceMaterialMap.get(A))f.material=s.meshReplaceMaterialMap.get(A);else{var m=new d.ShaderMaterial({uniforms:{color:{value:i[A]}},vertexShader:`
|
|
2033
|
+
`},mo=function(n){le(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(ga.uniforms),vertexShader:ga.vertexShader,fragmentShader:ga.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(i){this.uniforms.diffuse.value=i}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(i){this.uniforms.linewidth.value=i}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(i){this.uniforms.dashScale.value=i}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(i){this.uniforms.dashSize.value=i}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(i){this.uniforms.gapSize.value=i}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(i){this.uniforms.opacity.value=i}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(i){this.uniforms.resolution.value.copy(i)}}}),r.setValues(e),r}return t}(d.ShaderMaterial);Object.assign(mo.prototype,{isLineMaterial:!0});var yu=function(n){le(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new Ao,i.material=r!==void 0?r:new mo({color:Math.random()*16777215}),i}return t.prototype.computeLineDistances=function(){for(var e=this.geometry,r=e.attributes.instanceStart,i=e.attributes.instanceEnd,a=new Float32Array(2*r.count),o=new d.Vector3,s=new d.Vector3,l=0,u=0,c=r.count;l<c;l++,u+=2)o.fromBufferAttribute(r,l),s.fromBufferAttribute(i,l),a[u]=u===0?0:a[u-1],a[u+1]=a[u]+o.distanceTo(s);var f=new d.InstancedInterleavedBuffer(a,2,1);return e.setAttribute("instanceDistanceStart",new d.InterleavedBufferAttribute(f,1,0)),e.setAttribute("instanceDistanceEnd",new d.InterleavedBufferAttribute(f,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 i=e.ray,a=e.camera,o=a.projectionMatrix,s=this.geometry,l=this.material,u=l.resolution,c=l.linewidth,f=s.attributes.instanceStart,A=s.attributes.instanceEnd,m=new d.Vector4,h=new d.Vector4,v=new d.Vector4,g=new d.Vector3,p=new d.Matrix4,y=new d.Line3,w=new d.Vector3;i.at(1,v),v.w=1,v.applyMatrix4(a.matrixWorldInverse),v.applyMatrix4(o),v.multiplyScalar(1/v.w),v.x*=u.x/2,v.y*=u.y/2,v.z=0,g.copy(v);var b=this.matrixWorld;p.multiplyMatrices(a.matrixWorldInverse,b);for(var x=0,C=f.count;x<C;x++){m.fromBufferAttribute(f,x),h.fromBufferAttribute(A,x),m.w=1,h.w=1,m.applyMatrix4(p),h.applyMatrix4(p),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var M=m.z<-1&&h.z<-1,E=m.z>1&&h.z>1;if(!(M||E)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,y.start.copy(m),y.start.z=0,y.end.copy(h),y.end.z=0;var S=y.closestPointToPointParameter(g,!0);y.at(S,w);var I=d.MathUtils.lerp(m.z,h.z,S),P=I>=-1&&I<=1,R=g.distanceTo(w)<c*.5;if(P&&R){y.start.fromBufferAttribute(f,x),y.end.fromBufferAttribute(A,x),y.start.applyMatrix4(b),y.end.applyMatrix4(b);var L=new d.Vector3,F=new d.Vector3;i.distanceSqToSegment(y.start,y.end,F,L),r.push({point:F,pointOnLine:L,distance:i.origin.distanceTo(F),object:this,faceIndex:x})}}}},t}(d.Mesh);Object.assign(yu.prototype,{isLineSegments2:!0});var bu=function(n){le(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(yu);Object.assign(bu.prototype,{isLine2:!0});var wu=function(n){le(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,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setPositions.call(this,i),this},t.prototype.setColors=function(e){for(var r=e.length-3,i=new Float32Array(2*r),a=0;a<r;a+=3)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];return n.prototype.setColors.call(this,i),this},t.prototype.fromLine=function(e){var r=e.geometry;if(r instanceof d.Geometry){var i=new d.BufferGeometry().fromGeometry(r);this.setPositions(i.attributes.position.array)}else r instanceof d.BufferGeometry&&this.setPositions(r.attributes.position.array);return this},t.prototype.copy=function(){return this},t}(Ao);Object.assign(wu.prototype,{isLineGeometry:!0});var Ip="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW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r){e===void 0&&(e=new d.Vector3),r===void 0&&(r=new d.Vector3);var i=n.call(this)||this;i.type="FiveLine",i.needsRender=!0;var a=new wu,o=new mo({color:Qs,linewidth:Tp,dashScale:Pp,dashed:!1});i.line=new bu(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:Qs,size:Sp,map:zs||(zs=new d.TextureLoader().load(Ip)),sizeAttenuation:!1,transparent:!0});return i.points=new d.Points(s,l),i.points.renderOrder=11,i.points.frustumCulled=!1,i.setPoints(e,r),i.add(i.line,i.points),i}return Object.defineProperty(t,"version",{get:function(){return"6.1.5"},enumerable:!1,configurable:!0}),t.prototype.setPoints=function(e,r){var i=[].concat(e.toArray(),r.toArray());this.points.geometry.setAttribute("position",new d.BufferAttribute(new Float32Array(i),3)),this.line.geometry.setPositions(i),this.line.computeLineDistances(),this.needsRender=!0},t.prototype.getPoints=function(){var e=this.points.geometry.attributes.position.array;return[new d.Vector3(e[0],e[1],e[2]),new d.Vector3(e[3],e[4],e[5])]},t.prototype.setMaterial=function(e){var r=this.line.material;for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];i==="dashed"?(r.dashed=a,a?r.defines.USE_DASH="":delete r.defines.USE_DASH,r.needsUpdate=!0):r[i]=e[i]}this.needsRender=!0},t.prototype.setResolution=function(e,r){var i=this.line.material.resolution;(i.x!==e||i.y!==r)&&(i.set(e,r),this.needsRender=!0)},t}(d.Object3D);Object.assign(Da.prototype,{isFiveLine:!0});var Xe={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};function xu(n){return Pi(this,void 0,void 0,function(){var t;return Bi(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 Bp(n){return Pi(this,void 0,void 0,function(){var t,e;return Bi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,xu("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function Rp(n,t){return Pi(this,arguments,void 0,function(e,r,i,a){var o,s,l,u,c,f;return i===void 0&&(i=null),a===void 0&&(a=!0),Bi(this,function(A){switch(A.label){case 0:if(!e)throw new Error("No xrInputSource supplied");if(!r)throw new Error("No basePath supplied");return[4,Bp(r)];case 1:if(o=A.sent(),e.profiles.some(function(m){var h=o[m];return h&&(s={profileId:m,profilePath:"".concat(r,"/").concat(h.path),deprecated:!!h.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");if(l=o[i],!l)throw new Error('No matching profile name found and default profile "'.concat(i,'" missing.'));s={profileId:i,profilePath:"".concat(r,"/").concat(l.path),deprecated:!!l.deprecated}}return[4,xu(s.profilePath)];case 2:if(u=A.sent(),a){if(f=void 0,f=u.layouts[e.handedness],!f)throw new Error("No matching handedness, ".concat(e.handedness,", in profile ").concat(s.profileId));f.assetPath&&(c=s.profilePath.replace("profile.json",f.assetPath))}return[2,{profile:u,assetPath:c}]}})})}var Fp={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function kp(n,t){n===void 0&&(n=0),t===void 0&&(t=0);var e=n,r=t,i=Math.sqrt(n*n+t*t);if(i>1){var a=Math.atan2(t,n);e=Math.cos(a),r=Math.sin(a)}var o={normalizedXAxis:e*.5+.5,normalizedYAxis:r*.5+.5};return o}var Lp=function(){function n(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===Xe.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Fp)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=kp(e,r),s=o.normalizedXAxis,l=o.normalizedYAxis;switch(this.componentProperty){case Xe.ComponentProperty.X_AXIS:this.value=this.states.includes(a)?s:.5;break;case Xe.ComponentProperty.Y_AXIS:this.value=this.states.includes(a)?l:.5;break;case Xe.ComponentProperty.BUTTON:this.value=this.states.includes(a)?i:0;break;case Xe.ComponentProperty.STATE:this.valueNodeProperty===Xe.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(a):this.value=this.states.includes(a)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty ".concat(this.componentProperty))}},n}(),Op=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(i){var a=new Lp(e.visualResponses[i]);r.visualResponses[i]=a}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:Xe.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=k({id:this.id},this.values);return t},enumerable:!1,configurable:!0}),n.prototype.updateFromGamepad=function(t){var e=this;if(this.values.state=Xe.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=Xe.ComponentState.PRESSED:(r.touched||this.values.button>Xe.ButtonTouchThreshold)&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.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===Xe.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>Xe.AxisTouchThreshold&&(this.values.state=Xe.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(function(i){i.updateFromComponent(e.values)})},n}(),Vp=function(){function n(t,e,r){var i=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(a){var o=i.layoutDescription.components[a];i.components[a]=new Op(a,o)}),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}(),Np="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",Qp="generic-trigger",zp=function(n){le(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(i){i instanceof d.Mesh&&i.isMesh&&(i.material.envMap=r.envMap,i.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(i){var a=i.valueNode,o=i.minNode,s=i.maxNode,l=i.value,u=i.valueNodeProperty;a&&(u===Xe.VisualResponseProperty.VISIBILITY?a.visible=l:u===Xe.VisualResponseProperty.TRANSFORM&&(a.quaternion.copy(o.quaternion).slerp(s.quaternion,l),a.position.lerpVectors(o.position,s.position,l)))})}))},t}(Ln.Object3D);function Dp(n,t){Object.values(n.components).forEach(function(e){var r=e.type,i=e.touchPointNodeName,a=e.visualResponses;if(r===Xe.ComponentType.TOUCHPAD)if(e.touchPointNode=t.getObjectByName(i),e.touchPointNode){var o=new Ln.SphereGeometry(.001),s=new Ln.MeshBasicMaterial({color:255}),l=new Ln.Mesh(o,s);e.touchPointNode.add(l)}else console.warn("Could not find touch dot, ".concat(e.touchPointNodeName,", in touchpad component ").concat(e.id));Object.values(a).forEach(function(u){var c=u.valueNodeName,f=u.minNodeName,A=u.maxNodeName,m=u.valueNodeProperty;if(m===Xe.VisualResponseProperty.TRANSFORM){if(u.minNode=t.getObjectByName(f),u.maxNode=t.getObjectByName(A),!u.minNode){console.warn("Could not find ".concat(f," in the model"));return}if(!u.maxNode){console.warn("Could not find ".concat(A," in the model"));return}}u.valueNode=t.getObjectByName(c),u.valueNode||console.warn("Could not find ".concat(c," in the model"))})})}function Ds(n,t){Dp(n.motionController,t),n.envMap&&t.traverse(function(e){e instanceof d.Mesh&&e.isMesh&&(e.material.envMap=n.envMap,e.material.needsUpdate=!0)}),n.add(t)}var Up=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=Np,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new zp,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||Rp(o,e.path,Qp).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new Vp(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),Ds(r,i);else{if(!e.gltfLoader)throw new Error("GLTFLoader not set.");e.gltfLoader.load(r.motionController.assetUrl,function(f){e._assetCache[r.motionController.assetUrl]=f,i=f.scene.clone(),Ds(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function qp(n,t){return n}var Us=300,Hp=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),qs=new d.Vector3(-1,1,1),Gp=function(n){le(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Mp(r.renderer,r.renderer.getContext(),{onSessionStart:function(l){r.emit("xr.session.start",X("xr.session.start",{session:l,machineType:r.xrManager.machineType}))},onSessionEnd:function(){r.emit("xr.session.end",X("xr.session.end",{session:null,machineType:r.xrManager.machineType}))}}),r.xrControllerRay={left:new d.Raycaster,right:new d.Raycaster},r.xrControllerRay.left.params.Points={threshold:.1},r.xrControllerRay.right.params.Points={threshold:.1},r.gazeRay=null,r.pointerLines={left:new Da,right:new Da},r.pointerLines.left.visible=!1,r.pointerLines.right.visible=!0,r.pointerLines.left.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.left.points.material.depthTest=!1,r.pointerLines.right.setMaterial({color:new d.Vector3(1,1,1)}),r.pointerLines.right.points.material.depthTest=!1,r.controllerWrappers=[new d.Group,new d.Group];var i=r.xrManager.getController(0);r.controllerWrappers[0].add(i);var a=r.xrManager.getController(1);r.controllerWrappers[1].add(a);var o=new Up;o.gltfLoader={load:function(l,u){gi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return $a(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:gi})}).then(function(c){return u(c)})}},(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=wt()]={panoId:Ue(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=pt.shared.getContext();return s?(r.on("xr.session.end",function(){r.scene.remove(r.pointerLines.left,r.pointerLines.right)}),r.xrManager.setSession(s),r.on("xr.session.start",function(){var l=r.xrManager.getControllerGrip(0);l.add(o.createControllerModel(l)),r.controllerWrappers[0].add(l);var u=r.xrManager.getControllerGrip(1);u.add(o.createControllerModel(u)),r.controllerWrappers[1].add(u)}),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=k(k({},e),{maxLatitude:Math.PI/2,minLatitude:-Math.PI/2});return n.parseArgs.call(this,r)},t.initAnimationEndState=function(e){var r=this.parseArgs(e),i=n.initAnimationEndState.call(this,r);return k(k({},i),{mode:"XRPanorama"})},t.prototype.moveToPano=function(e,r,i){var a=this,o,s,l,u,c=(o=r.effect)!==null&&o!==void 0?o:"fade";this.userAction=i,this.stopMomentumMovement();var f=this.works.getResolvedObserver(e);if(!f)throw new Error("Invalid PanoIndex");var A=qn(f.images.up),m=this.imageOptions.size;typeof m=="undefined"&&f&&A&&(m=Number(A)),typeof m=="undefined"&&(m=2048);var h=this.imageOptions.transform,v=function(P,R){return qp(yi(P,h,R))},g=k({key:"pano.".concat(f.panoId)},Er(this.imageOptions,["format","size","quality"])),p=f.images,y=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(P){return P.size>m}))!==null&&l!==void 0?l:null,w="pano:"+zn([p,g,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===w)return;var b=this.pendingTextureTask.panoId;(u=this.panoMeshes[b])===null||u===void 0||u.setProgress(0),this.emit("pano.texture.abort",X("pano.texture.abort",{error:null,progress:0,meta:null,pano:f.pano})),this.pendingTextureTask.onError(new Error("texture aborted"))}var x=this.models.getMaterial()||{},C=x.pano0,M=x.pano1,E;if((C==null?void 0:C.map.name)===w?E=C:(M==null?void 0:M.map.name)===w&&(E=M),E){var S={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:E.map,luminanceMap:E.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,qs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,S,r);return}var I="move-to-pano-"+f.panoId;this.pending.add(I),this.pendingTextureTask={panoId:f.panoId,hash:w,onLoad:function(P){if(a.pending.delete(I),a.destroyed)P.body.dispose();else{P.body.name=w;var R={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:P.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,qs)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,R,r)}},onError:function(P){a.pending.delete(I);var R=k(k(k({},f.pano),{mode:a.mode}),_e(a.camera.pose));a.emit("pano.error",X("pano.error",{error:P,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:R})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:R})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&y&&y.length?this.textureLoader.loadTiledCubeTexture(p,y,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:v,options:g},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(P){var R,L;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:P,meta:null,pano:f.pano})),((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(P))},this.renderer):this.textureLoader.loadCubeTexture(p,{imageURL:{transform:v,options:g},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(P){var R,L;((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&((L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(P)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:P,meta:null,pano:f.pano}))},this.renderer)]).then(function(P){var R,L,F=P[0];((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w?(a.pendingTextureTask.onLoad(F),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:F.meta,pano:f.pano}))):F.body.dispose()}).catch(function(P){var R,L;((R=a.pendingTextureTask)===null||R===void 0?void 0:R.hash)===w&&(a.pendingTextureTask.onError(P),(L=a.panoMeshes[f.panoId])===null||L===void 0||L.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:P,progress:0,meta:null,pano:f.pano})),a.emit("error",P))}),this.emit("pano.texture.load",X("pano.texture.load",{error:null,progress:0,meta:null,pano:f.pano}))},t.prototype.doMoveToPano=function(e,r,i){var a=this,o,s,l,u,c,f,A,m,h,v;i===void 0&&(i={});var g=Me(),p=wt();this.panoResources[p]=r;var y=1,w,b,x;if(this.locationMotion.ended){var C=this.locationMotion.getKeyFrameSegment(g);C[0];var M=C[1],E=this.locationMotion.value,S=this.panoResourceFromLocationMotionKeyframe(M).position,I=r.position;w=Math.max(S.distanceTo(I),y),b=[{key:M.key,progress:0,value:k(k({},E),{count:0})},{key:p,progress:1,value:{distance:0,count:1}}],x=0}else{var P=this.locationMotion.getKeyFrameSegment(g),R=P[0],M=P[1],E=this.locationMotion.value,L=this.panoResourceFromLocationMotionKeyframe(R).position,S=this.panoResourceFromLocationMotionKeyframe(M).position,I=r.position,F=M.value.count-E.count,O=Math.max(L.distanceTo(S),y)*F,Q=Math.max(S.distanceTo(I),y);w=O+Q,b=[{key:R.key,progress:0,value:k({},E)},{key:M.key,progress:O/w,value:M.value},{key:p,progress:1,value:{count:M.value.count+1,distance:0}}];var N=this.locationMotionKeyframesLength(this.locationMotion.keyframes),W=this.locationMotionKeyframesLength(b);x=this.locationMotion.getProgressVelocity(g)*N/W}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?w:0),D={longitude:i.longitude,latitude:i.latitude,fov:i.fov},G=k(k({},e),{mode:this.mode,longitude:(o=D.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=D.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=D.fov)!==null&&l!==void 0?l:this.camera.pose.fov,offset:r.position.clone(),distance:0}),J=this.currentPano;if(this.emit("pano.moveTo",X("pano.moveTo",{options:i,prevPano:J,progress:0,state:G,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(G),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=z,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(D,K).catch(z);else{var H=Lt({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),j=Lt({longitude:(u=D.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=D.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),Y=new d.Object3D;Y.lookAt(H);var _=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion);Y.lookAt(j);var pe=new d.Matrix4().makeRotationFromQuaternion(Y.quaternion),ee=new d.Matrix4().getInverse(_).premultiply(pe),oe=this.cameraMotion.value.fov,ie=(f=D.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,ce=1;r.effect==="zoomin"?ce=1.5:r.effect==="zoomout"&&(ce=.4);for(var ne=ie*ce,ae=0;ae<b.length-1;ae++){var he=b[ae].key;if(he){var ve=this.panoResources[he];ve&&(ve.fixCameraTransform.copy(ee),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(oe/2/180*Math.PI)/Math.tan(ne/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:(A=D.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=D.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ne}},{progress:1,value:{longitude:(h=D.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(v=D.latitude)!==null&&v!==void 0?v:this.cameraMotion.value.latitude,fov:ie}}],K).catch(z)}var we=this.locationMotion.setKeyframes(b,K,x);we.then(function(){for(var Ce,Be,$,te=0,U=a.models;te<U.length;te++){var Le=U[te];Le.show()}var Pe=k(k({},e),{mode:a.mode,longitude:a.camera.pose.longitude,latitude:a.camera.pose.latitude,fov:a.camera.pose.fov,offset:a.camera.pose.offset.clone(),distance:0});a.emit("pano.arrived",X("pano.arrived",{options:i,prevPano:J,progress:1,state:Pe,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(Pe);var Se=a.works.getResolvedObserver(a.currentPano);if(Se&&Se.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var De=Hp.clone().multiply(($=(Be=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Be===void 0?void 0:Be.matrix)!==null&&$!==void 0?$:new d.Matrix4).multiply(Se.video.matrix),ye={map:a.videoTexture,size:Se.video.size,matrix:De,alpha:1},be=wt(),ge=a.videoTexture.image;ge.setAttribute("uuid",be),cu().then(function(me){me&&Se.video&&ge.getAttribute("uuid")===be&&(ge.oncanplay=function(){ge.oncanplay=z,ge.play()},ge.ontimeupdate=function(){ge.currentTime>.5&&(ge.ontimeupdate=z,a.panoVideo.setMaterial(ye))},ge.src=Se.video.source)}).catch(function(){ge.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:G,userAction:a.userAction,error:null})),i.moveCancelCallback&&i.moveCancelCallback()})},t.prototype.checkSelectedPano=function(e){var r=this,i,a,o,s;this.stopMomentumMovement();var l=this.camera.getDirection(new d.Vector3).setY(0),u=null,c=this.works.getResolvedObserver(this.currentPano);if(!c)return null;var f=c.accessibleIds.filter(function(j){var Y=ht(j);if(Wt(Y,r.currentPano))return!1;var _=r.works.getResolvedObserver(Y);return!_||_.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:_.loadable||_.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=ur(f,function(j){var Y=r.works.getResolvedObserver(j);if(!Y)return 1/0;var _=Y.standingPosition.clone();return _.distanceTo(A.point)},!0),h=m[0],v=m[1];h&&v<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(Vs(u)){var g=this.getForwardObserverOrNot(e);g&&(u=g)}for(var p=0,y=this.locationMotion.keyframes;p<y.length;p++){var w=y[p],b=this.panoResourceFromLocationMotionKeyframe(w);if(!(w.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(Vs(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var x=u.panoId;this.panoMeshes[x]&&(this.panoMeshes[x].setDisabled(!1),this.panoMeshes[x].setLoading(!0))}var C={};if(u){for(var M=Math.PI/6,E=Math.PI/12,S=new d.Vector3(0,1,0),I=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),P=I.clone().applyAxisAngle(S,M),R=I.clone().applyAxisAngle(S,-M),L=[],F=[],O=[],Q=0,N=u.accessibleIds;Q<N.length;Q++){var h=N[Q],W=ht(h);if(!(Wt(W,this.currentPano)||Wt(W,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var D=K.position.clone().sub(u.position).setY(0);I.angleTo(D)<M?O.push(D):P.angleTo(D)<M?L.push(D):R.angleTo(D)<M&&F.push(D)}}}var G=O.length>0?O:yt(yt([],L,!0),F,!0),J=G.slice().sort(function(j,Y){return j.angleTo(I)-Y.angleTo(I)})[0];J&&J.angleTo(l)>E&&(C.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(C.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(C.fov=this.defaultFov);var H={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=C.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=C.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=C.fov)!==null&&s!==void 0?s:this.camera.pose.fov,distance:0,offset:u?u.position.clone():new d.Vector3};return this.emit("pano.select",X("pano.select",{prevPano:this.currentPano,state:H,userAction:!0,options:C,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:H,options:C,error:null})),u.pano):null},t.prototype.destroy=function(){n.prototype.destroy.call(this)},t.prototype.isReady=function(){return!1},t.prototype.updateCamera=function(e,r,i){return Promise.resolve()},t.prototype.updateCameraWithKeyframes=function(e,r,i){return Promise.resolve()},t.prototype.updateTime=function(e,r){for(var i=this,a,o,s,l,u,c,f,A,m=[],h=2;h<arguments.length;h++)m[h-2]=arguments[h];this.userAction=!0;var v={},g={},p=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),y=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),w=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),g.longitude=this.cameraMotion.value.longitude,g.latitude=this.cameraMotion.value.latitude,g.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),v.modelAlpha=this.modelAlphaMotion.value.modelAlpha),this.perspToOrthoMotion.ended===!1&&(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),this.locationMotion.ended===!1){this.locationMotion.update(e);var b=this.locationMotion.getKeyFrameSegment(e),x=b[0],C=b[1],M=this.panoResourceFromLocationMotionKeyframe(x),E=this.panoResourceFromLocationMotionKeyframe(C),S=new d.Vector3().copy(M.position),I=new d.Vector3().copy(E.position),P=this.locationMotion.value.count-C.value.count+1;v.progress=P,E.leftPanoPicture&&(P<1?M.leftPanoPicture&&(v.pano0=M.leftPanoPicture):v.pano0=E.leftPanoPicture,v.pano1=E.leftPanoPicture),E.effect==="montage"?v.transition="BLACK":E.effect==="spread"?v.transition="SPREAD":v.transition="FADE",(E.effect==="zoomin"||E.effect==="zoomout")&&(v.progress=Math.pow(P,3)),P<1&&E.effect!=="fly"&&(v.pano0&&M.leftPanoPicture&&(v.pano0={map:v.pano0.map,zoom:v.pano0.zoom,luminanceMap:v.pano0.luminanceMap,matrix:M.leftPanoPicture.matrix.clone().setPosition(E.position)}),S.copy(I),w=!0),g.distance=this.locationMotion.value.distance,g.offset=new d.Vector3(S.x+(I.x-S.x)*P,S.y+(I.y-S.y)*P,S.z+(I.z-S.z)*P);for(var R=[],L=[],F=0,O=this.locationMotion.keyframes;F<O.length;F++){var Q=O[F],N=Q.key,W=Q.progress;N!==void 0&&(R.push(N),W>this.locationMotion.progress&&L.push(N))}for(var K=0,D=Object.keys(this.panoResources);K<D.length;K++){var G=D[K];if(!(L.indexOf(G)>=0)){var J=this.panoResources[G];if(J.leftPanoPicture){var H=J.leftPanoPicture.map;if(H){if(H===((a=v.pano0)===null||a===void 0?void 0:a.map)||H===((o=v.pano1)===null||o===void 0?void 0:o.map))continue;H instanceof Qe&&H.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(H.cubeRenderTarget),H.dispose(),J.leftPanoPicture=null}}R.indexOf(G)>=0||delete this.panoResources[G]}}this.currentPano=ht(E.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:ht(p.panoId),state:k(k(k(k({},ht(y.panoId)),{mode:this.mode}),_e(this.camera.pose)),g),options:{},progress:this.locationMotion.progress,error:null}))}Nt(v)===!1&&(!((s=v.pano0)===null||s===void 0)&&s.map&&v.pano0.map instanceof Qe&&!v.pano0.map.cubeRenderTarget&&(v.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=v.pano1)===null||l===void 0)&&l.map&&v.pano1.map instanceof Qe&&!v.pano1.map.cubeRenderTarget&&(v.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(v)),Nt(g)===!1&&this.setCamera(g);var j=this.works.getResolvedObserver(this.currentPano),Y=m[1];if(!Y){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var _=this.xrManager.referenceSpace;if(_){var pe=this.xrManager.cameraVR,ee=this.xrManager.cameraL,oe=this.xrManager.cameraR,ie=[ee,oe],ce=Y.getViewerPose(_),ne=new d.Vector3(0,0,0);if(ce){var ae;ae=this.xrManager.session.renderState.baseLayer;var he=ce.views;if(!ae){console.error("no layer found");return}this.renderer.setFramebuffer(ae.framebuffer);var ve=!1;he.length!==pe.cameras.length&&(pe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var we=new d.Vector3,Ce=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(we,new d.Quaternion,new d.Vector3),new d.Matrix4().fromArray(he[1].transform.matrix).decompose(Ce,new d.Quaternion,new d.Vector3),Ce.clone().sub(we).normalize();var Be=new d.Vector3,$=new d.Quaternion,te=new d.Vector3;this.camera.matrix.decompose(Be,$,te);for(var U=0;U<he.length;U++){var Le=he[U],Pe=ae.getViewport(Le),Se=ie[U];Se.matrix.fromArray(Le.transform.matrix);var De=new d.Vector3,ye=new d.Quaternion,be=new d.Vector3;Se.matrix.decompose(De,ye,be),ne.copy(Be),Se.position.copy(Be),Se.quaternion.copy(ye),Se.scale.copy(be),Se.updateMatrix(),Se.projectionMatrix.fromArray(Le.projectionMatrix),Se.viewport.set(Pe.x,Pe.y,Pe.width,Pe.height),ve===!0&&pe.cameras.push(Se)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var U=0;U<this.xrManager.session.inputSources.length;U++)if(this.xrManager.session.inputSources[U]&&this.xrManager.session.inputSources[U].targetRayMode==="transient-pointer"){var ge=Y.getPose(this.xrManager.session.inputSources[U].targetRaySpace,_);if(ge){var me=new d.Vector3(0,0,-1).applyQuaternion(ge.transform.orientation),Ae=new d.Raycaster(this.camera.position,me);this.gazeRay=Ae}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Ne=this.xrManager.session.inputSources,U=0;U<Ne.length;U++){var ze=this.xrManager.controllers[U],je=Ne[U];if(je){ze&&ze.update(je,Y,_);var Ae=this.xrManager.getController(U),cr=new d.Vector3(0,1.2,0),ke=Ae.position.clone().add(ne).sub(cr);je.handedness==="left"?this.xrControllerRay.left.set(ke,new d.Vector3(0,0,-1).applyEuler(Ae.rotation)):je.handedness==="right"&&this.xrControllerRay.right.set(ke,new d.Vector3(0,0,-1).applyEuler(Ae.rotation)),this.controllerWrappers[U].position.copy(new d.Vector3(0,0,0).add(ne).sub(cr));var Ye=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ye.length===0&&(Ye=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Jr;return k({floor:(Jr=j==null?void 0:j.floorIndex)!==null&&Jr!==void 0?Jr:0},Ir)})),Ye.length>=1&&Ye[0].face)if(je.handedness==="right"){var xt=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),Zt=Ye[0].face.normal,nn=Zt.clone(),Yt=Ye[0].point.clone();this.intersectMesh.position.copy(Yt);var St=Yt.clone().add(nn);if(this.intersectMesh.lookAt(St),Math.abs(Zt.y)>.99){var $t=this.camera.position.clone().sub(Yt);this.intersectMesh.rotation.z=-Math.atan2($t.z,$t.x)}this.intersectMesh.visible=!0,this.needsRender=!0,xt.length>0?(this.pointerLines.right.setPoints(ke,xt[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(ke,Ye[0].point));var Cr=Ye[0],Qt=X("intersect.update",{raycaster:(u=this.xrControllerRay.right)!==null&&u!==void 0?u:null,intersection:Cr!=null?Cr:null,object:this.intersectMesh});if(this.emit("intersect.update",Qt),Qt.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(ke,Ye[0].point)}}this.updateControllerHelper(Ne,e,r)}if(this.camera.pose.distance>.1||w)for(var er=0,zt=Object.keys(this.panoMeshes);er<zt.length;er++){var ut=zt[er],Oe=this.panoMeshes[ut];Oe.setOpacity(0),Oe.setCurrent(!1),Oe.updateTime&&Oe.updateTime(e,r),Oe.visible=!1}else if(j){var dr=ur(j.visibleIds,function(lt){var qt=i.works.getResolvedObserver(lt);return qt?j.standingPosition.distanceTo(qt.standingPosition):1/0},!0),vt=dr[1];vt=fe(vt,2.5,1/0);for(var fr=j.visibleIds.concat(Ue(this.currentPano)),hr=this.getForwardObserverOrNot(),Dt=this.camera.getDirection(new d.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var ut=pr[Et],Oe=this.panoMeshes[ut],Mr=this.works.getResolvedObserver(ut);if(fr.indexOf(ut)===-1)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Mr)Oe.setCurrent(!1),Oe.setOpacity(0);else if(!Mr.loadable&&!Mr.active)Oe.setCurrent(!1),Oe.setOpacity(0);else{var an=Oe.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Oe.setCurrent(!Oe.loading&&Oe.progress===0&&hr!==null&&hr.panoId===ut),Oe.setOpacity(an<.01?0:fe(vt/an*1.2,.65,.98));var Kr=this.camera.position.clone().setY(Oe.position.y),me=new d.Vector3().copy(Oe.position).sub(Kr).normalize();if(ut===Ue(this.currentPano)){var jr=fe((.5-Kr.distanceTo(Oe.position))/.5,0,1);me.multiplyScalar(1-jr).add(Dt.clone().multiplyScalar(jr))}me.length()>0&&Oe.quaternion.setFromEuler(new d.Euler(0,Math.atan2(me.x,me.z),0))}Oe.updateTime&&Oe.updateTime(e,r)}}var Ut=function(){return 4}(),et=function(){var lt=new d.PerspectiveCamera;lt.applyMatrix4(pe.matrix),lt.position.set(0,0,0);var qt=i.works.getResolvedObserver(y.panoId),Ir=qt!=null?qt:j;Ir&<.quaternion.premultiply(Ir.quaternion.clone().inverse()),lt.updateProjectionMatrix(),lt.updateMatrixWorld(!0);var Jr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(lt.projectionMatrix,lt.matrixWorldInverse));return Jr}();y.panoId===Ue(this.currentPano)&&((c=y.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Qe&&(y.leftPanoPicture.map.update(et,Ut),y.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var Ge=this.tiling.object.visible;if(Ut>this.TILED_CUBE_TEXTURE_LEVEL&&this.initAnimationed){var nt=y.panoId,At=this.works.getResolvedObserver(nt);At?Wn(this.camera.position,At.position)&&this.locationMotion.ended?(this.tiling.object.visible=!0,this.tiling.panoId!==nt&&this.tiling.cleanup(),this.tiling.panoId=nt,this.tiling.setResource((A=(f=At.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&At.images.luminance?At.images.luminance:null),this.tiling.setFetcher(it(At.work)),this.tiling.setRotation(At.quaternion),this.tiling.setPosition(At.position),this.tiling.update(et,Ut,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;Ge!==this.tiling.object.visible&&(this.tiling.object.needsRender=!0,this.modelSceneNeedsRender=!0)}this.panoVideo.object.position.copy(this.camera.position),this.panoVideo.updateTime(e)}}},t.prototype.render=function(){var e=this.xrManager.getCamera(this.camera);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,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(!(!e||e.length===0)){for(var s={buttons:{X:!1,Y:!1,LeftTrigger:!1,LeftPinch:!1,A:!1,B:!1,RightTrigger:!1,RightPinch:!1}},l=0;l<e.length;l++){var u=e[l].handedness,c=e[l].gamepad;switch(u){case"left":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"LeftAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"LeftAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"LeftAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"LeftAxesDown",r)),c!=null&&c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"X",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"Y",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"LeftTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"LeftPinch",r));var f={raycaster:a,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.buttons.X=c.buttons&&c.buttons[4]?c.buttons[4].pressed:!1,s.buttons.Y=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.LeftTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.LeftPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1,s.left=f;break;case"right":c.axes&&(this.emitHandleEvent(c.axes[2]===-1,"RightAxesLeft",r),this.emitHandleEvent(c.axes[2]===1,"RightAxesRight",r),this.emitHandleEvent(c.axes[3]===-1,"RightAxesUp",r),this.emitHandleEvent(c.axes[3]===1,"RightAxesDown",r)),c.buttons&&(c.buttons[4]&&this.emitHandleEvent(c.buttons[4].pressed,"A",r),c.buttons[5]&&this.emitHandleEvent(c.buttons[5].pressed,"B",r),c.buttons[0]&&this.emitHandleEvent(c.buttons[0].pressed,"RightTrigger",r),c.buttons[1]&&this.emitHandleEvent(c.buttons[1].pressed,"RightPinch",r));var A={raycaster:o,axes:{up:c.axes&&c.axes[3]<0?Math.abs(c.axes[3]):0,down:c.axes&&c.axes[3]<0?0:Math.abs(c.axes[3]),left:c.axes&&c.axes[2]<0?Math.abs(c.axes[2]):0,right:c.axes&&c.axes[2]<0?0:Math.abs(c.axes[2])},deltaTime:i};s.right=A,s.buttons.A=c.buttons&&c.buttons[4]?c==null?void 0:c.buttons[4].pressed:!1,s.buttons.B=c.buttons&&c.buttons[5]?c==null?void 0:c.buttons[5].pressed:!1,s.buttons.RightTrigger=c.buttons&&c.buttons[0]?c==null?void 0:c.buttons[0].pressed:!1,s.buttons.RightPinch=c.buttons&&c.buttons[1]?c==null?void 0:c.buttons[1].pressed:!1;break}}this.emit("xr.controller.update",X("xr.controller.update",s))}},t.prototype.emitHandleEvent=function(e,r,i){var a=this.xrControllerRay.left,o=this.xrControllerRay.right;if(e)if(this.xrHandleState[r].touchStart===!1)this.xrHandleState[r].touchStartTime=i,this.xrHandleState[r].touchStart=!0,this.emit("xr.gesture.buttonDown",X("xr.gesture.buttonDown",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!1,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}));else{var s=i-this.xrHandleState[r].touchStartTime;s>Us&&this.emit("xr.gesture.press",X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!0,controllers:{raycaster:{leftRay:a,rightRay:o}}}))}else if(this.xrHandleState[r].touchStart===!0){this.emit("xr.gesture.buttonUp",X("xr.gesture.buttonUp",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}));var s=i-this.xrHandleState[r].touchStartTime;if(s<=Us){var l=X("xr.gesture.tap",{session:this.xrManager.session,machineType:this.xrManager.machineType,buttons:r,isFinal:!0,isFirst:!1,controllers:{raycaster:{leftRay:a,rightRay:o}}}),u=this.emit("xr.gesture.tap",l);!u&&!l.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}(ho),Bt={Floorplan:za,Topview:Ah,Panorama:ho,VRPanorama:lp,Model:dp,Mapview:xp,XRPanorama:Gp},Eu=["gesture.pan","gesture.tap","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 Kp(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.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=Lt(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 jp(){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 Hs(n){{var t=new d.DirectionalLight(16777215,.3);t.position.copy(new d.Vector3(1,1,1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);t.position.copy(new d.Vector3(-1,-1,-1)),n.add(t)}{var t=new d.DirectionalLight(16777215,.1);n.add(t)}{var t=new d.AmbientLight(16777215,.6);n.add(t)}}function Jp(n){for(var t,e,r={},i=n.split(/(\;|\,)/),a=0,o=i;a<o.length;a++){var s=o[a],l=s.split("="),u=(t=l[0])===null||t===void 0?void 0:t.trim(),c=(e=l[1])===null||e===void 0?void 0:e.trim();u&&c&&(r[u]=c)}return r}function Cu(){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 i=Jp((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const Xp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAA/CAQAAADtPwPkAAAR+0lEQVR4AezYg3LEQACH8d1cbdu23Q5qG9G47z/TN/h6tn2b/H+TUTLc7yjcOXV46OUAnUs6EbUp022ZBXc1NhoZYYd7fjDRvdcHAwrlK2QBVJ4sgoqONmY45RUT23sZ6H42F2hK5CtkMbjhZlDmUUcvq1zyieUVyjbE4I1GBfItwxG56YaUZTQwyh4P6NgJ4YYYvCuQb5kOyI03pORjiqe4Lwpq5pt1vJqfUwKWJVbSMYfppYconG+maNNQOWBZuwHTzicGel75NtFOkxr5apmV8cikcko0DrDQs863AeGl0cE0+1xy573m0/wf0cEKW6H7BWtggiMG8sy3oHRDpJMw4NWb6am/bv9znkqEzjd61t5oo5clTrjhwevO75EJRBKSRt745Z16ZEjcM73sccZplBPm8PyTcxZAkSRdHm/acJ0Z3JZhHB0BxqDHgWFZFmm0ZbCw87twI/zc3e/Cz93vPneXtU/WdQS3oTviXdY/q5PsJKfoGuQjZuO/0in1qsj85cuXrxqe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4YZdZumSOwsVzFeBWdr37tpIhOpSwXqONNgZq/2KgvBt54znHN1HzlljTO4oVD5fb+prNIJXQNL1ofDKQisbPLJDv3jNSLq9OkYBEIihKIj3v7S1TRQCX5Kdl1ZQlol7LF+E++fwirfiq2sf4cTXxc6hzxffPuLEeqSWrPGWMF58TWr5viyJAP5/4EV4KePiaSE8eNRgjDy8/tyRW+FZjhS+2tlovNJovtJovNJ0uhK6Wo64SDdxEbM//KesjwAAAABJRU5ErkJggg==";var Gs=[351,63],Ks=[20,20],Wp=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_p=new Float32Array([0,0,1,0,0,1,1,1]),Zp=new Uint8Array([0,1,2,1,3,2]),Vi=new d.BufferGeometry;Vi.setAttribute("position",new d.BufferAttribute(Wp,3));Vi.setAttribute("uv",new d.BufferAttribute(_p,2));Vi.setIndex(new d.BufferAttribute(Zp,1));var Ai=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Mu=new d.Mesh(Vi,Ai);Mu.matrixAutoUpdate=!1;var go=new d.Scene;go.add(Mu);go.matrixAutoUpdate=!1;var _n=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);_n.position.set(0,0,.5);_n.lookAt(0,0,0);_n.updateMatrixWorld(!0);_n.matrixAutoUpdate=!1;var Yp=new d.Vector4,$p=new d.Vector4;function ev(n){if(Ai.map){var r=n.getViewport(Yp),i=n.getScissor($p),a=n.getScissorTest(),o=n.autoClear,s=i.x+Ks[0]/3,l=i.y+Ks[1]/3,u=Gs[0]/3,c=Gs[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(go,_n),n.setViewport(r),n.setScissor(i),n.setScissorTest(a),n.autoClear=o}else{var t=new d.Texture,e=new Image;e.onload=function(){t.image=e,t.wrapS=d.ClampToEdgeWrapping,t.wrapT=d.ClampToEdgeWrapping,t.minFilter=d.LinearFilter,t.needsUpdate=!0,t.generateMipmaps=!1,Ai.needsUpdate=!0,e.onload=z},e.src=Xp,Ai.map=t}}var tv=800,js=90,rv=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/")},nv=new d.Vector2,si=new d.Frustum,ui=new d.Matrix4,Js=new WeakMap,ya=new WeakMap,Xs=La([]),Iu=function(n){le(t,n);function t(e){e===void 0&&(e={});var r,i,a,o,s,l,u,c,f,A,m,h=n.call(this)||this;if(h.ident=wt(),typeof window!="undefined"&&(Ua.instances[h.ident]=h),h.renderSwitch01=0,h.currentMode="Panorama",h.pano={workCode:"",panoIndex:0},h.needsRender=!1,h.modelSceneNeedsRender=!1,h.onlyRenderIfNeeds=(r=e.onlyRenderIfNeeds)!==null&&r!==void 0?r:!0,h.imageOptions=k({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=k({},(a=e.textureOptions)!==null&&a!==void 0?a:{}),h.poweredByRealsee=(o=e.poweredByRealsee)!==null&&o!==void 0?o:!0,h.extraElements=[],h.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)},h.fps={testCount:0,testTime:Me()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:tv,h.enableWheel=(l=e.enableWheel)!==null&&l!==void 0?l:!0,typeof window!="undefined")if("renderer"in e)e.renderer instanceof _r&&h.throwError(new Error("cannot render a internal renderer")),h.renderer=e.renderer;else try{h.renderer=new _r({preserveDrawingBuffer:e.preserveDrawingBuffer,backgroundColor:e.backgroundColor,backgroundAlpha:e.backgroundAlpha,antialias:e.antialias,webgl2:e==null?void 0:e.webgl2});var v=Cu();h.renderer.setPixelRatio(v===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(I){I instanceof Error&&h.throwError(I)}h.getPixelsRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(c=(u=h.renderer)===null||u===void 0?void 0:u.outputEncoding)!==null&&c!==void 0?c:d.sRGBEncoding});var g=new d.DepthTexture(1,1);g.format=d.DepthStencilFormat,g.type=d.UnsignedInt248Type,h.modelRenderTarget=new d.WebGLRenderTarget(1,1,{encoding:(A=(f=h.renderer)===null||f===void 0?void 0:f.outputEncoding)!==null&&A!==void 0?A:d.sRGBEncoding,depthTexture:g,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new Fi(js),h.scene=new p0,h.xrCustomObjectsScene=new d.Scene,h.scene.add(h.xrCustomObjectsScene),h.scene.matrixAutoUpdate=!1,h.lastLoadWorkTask=Promise.resolve(),h.requestProxy=(m=e.requestProxy)!==null&&m!==void 0?m:rv,h.networkSubscribe=new r0,h.networkSubscribe.on("network",function(I,P,R,L){var F;h.emit("network.resource",X("network.resource",{source:I,requestType:P,requestState:R,detail:L})),(F=h.analysis)===null||F===void 0||F.network(h.works,I,P,R,L)}),h.boundingMesh=eh(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=gs(),h.models.push(new Va),h.lastModels=gs(),h.lastWorks=La([]),h.readyCallbacks=[],h.syncingState=!1,h.helperGroup=new d.Group,h.helperGroup.name="helper",h.helperGroup.matrixAutoUpdate=!1,h.scene.add(h.helperGroup),h.modelGroup=new d.Group,h.modelGroup.visible=!1,h.modelGroup.name="model",h.modelGroup.matrixAutoUpdate=!1,h.modelScene=new d.Scene,h.modelScene.add(h.modelGroup),h.modelScene.add(h.boundingMesh),h.modelScene.matrixAutoUpdate=!1,h.videoTexture=new d.VideoTexture(e.videoInstance||jp()),Hs(h.scene),Hs(h.modelScene),h.state={mode:h.currentMode,workCode:h.pano.workCode,panoIndex:h.pano.panoIndex,longitude:h.camera.pose.longitude,latitude:h.camera.pose.latitude,fov:h.camera.pose.fov,offset:h.camera.pose.offset.clone(),distance:h.camera.pose.distance},h.stateSynced=!1,h._enablePostProcessing=!1,h._enableIOSEDR=!1,h._enableEDL=!1,h._enableHQ=!1,h.destroyed=!1,h.paused=!0,typeof window!="undefined"&&(e.play!==!1&&h.play(),h.stopAnimationLoop=pt.shared.add(function(I,P){for(var R=[],L=2;L<arguments.length;L++)R[L-2]=arguments[L];h.updateTime.apply(h,yt([I,P],R,!1))},!1,0,10));var p=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},y=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",y,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",p,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",y,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var w=0,b=e.plugins;w<b.length;w++){var x=b[w];if(typeof x=="function")x(h);else if(Array.isArray(x)){var C=x[0],M=x[1],E=x[2];if(typeof C=="function"){var S=C(h,E);typeof M=="string"&&(h.plugins[M]?h.throwError(new Error("plugin name ".concat(M," is exists."))):h.plugins[M]=S)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,Kp(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.1.5"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Ci.decoderPath},set:function(e){Ci.setDecoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"ktx2Path",{get:function(){return Qn.transcoderPath},set:function(e){Qn.setTranscoderPath(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"panoIndex",{get:function(){return this.pano.panoIndex},enumerable:!1,configurable:!0}),t.prototype.getGPUPicking=function(e,r,i,a,o){var s=this;if(a===void 0&&(a=1),o===void 0&&(o=new d.Vector3(0,0,0)),!this.renderer)throw new Error("renderer is not initialized.");this.models.setMaterial({constantColor:o}),this.scene.traverse(function(f){if(!(!(f instanceof d.Mesh)||f instanceof It)){var A=Object.keys(i).filter(function(h){return h===f.uuid})[0];if(A)if(s.meshOriginMaterialMap.set(A,f.material),s.meshReplaceMaterialMap.get(A))f.material=s.meshReplaceMaterialMap.get(A);else{var m=new d.ShaderMaterial({uniforms:{color:{value:i[A]}},vertexShader:`
|
|
2034
2034
|
void main() {
|
|
2035
2035
|
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
|
2036
2036
|
gl_Position = projectionMatrix * mvPosition;
|
package/five/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.1.
|
|
4
|
+
* Generated: 9/20/2024
|
|
5
|
+
* Version: 6.1.5
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -20050,7 +20050,7 @@ var gp = { type: "move" }, ks = (
|
|
|
20050
20050
|
var i, a, o, s, l;
|
|
20051
20051
|
this.isPanorama = (i = r == null ? void 0 : r.isPanorama) !== null && i !== void 0 ? i : !0;
|
|
20052
20052
|
var u = navigator.userAgent.toLowerCase(), c;
|
|
20053
|
-
u.includes("
|
|
20053
|
+
u.includes("pico") ? c = "Pico" : u.includes("oculus") ? c = "Oculus" : c = "VP", this.machineType = (a = r == null ? void 0 : r.machineType) !== null && a !== void 0 ? a : c, this.renderer = t, this.gl = e, this.enabled = !1, this.session = null, this.referenceSpaceType = (o = r == null ? void 0 : r.referenceSpaceType) !== null && o !== void 0 ? o : "local-floor", this.referenceSpace = null, this.onSessionStartCallback = (s = r == null ? void 0 : r.onSessionStart) !== null && s !== void 0 ? s : z, this.onSessionEndCallback = (l = r == null ? void 0 : r.onSessionEnd) !== null && l !== void 0 ? l : z, this.controllers = [new ks(), new ks()], this.inputSourcesMap = /* @__PURE__ */ new Map(), this.cameraVR = new d.ArrayCamera(), this.cameraL = new d.PerspectiveCamera(), this.cameraR = new d.PerspectiveCamera(), this.cameraL.viewport = new d.Vector4(), this.cameraR.viewport = new d.Vector4(), this.cameraL.layers.enable(1), this.cameraR.layers.enable(2), this.cameraVR.layers.enable(1), this.cameraVR.layers.enable(2), this.isPresenting = !1, this.currentDepthNear = null, this.currentDepthFar = null, this.cameraLPos = new d.Vector3(), this.cameraRPos = new d.Vector3();
|
|
20054
20054
|
}
|
|
20055
20055
|
return n.prototype.getController = function(t) {
|
|
20056
20056
|
var e = this.controllers[t];
|
|
@@ -20637,7 +20637,7 @@ var wp = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA
|
|
|
20637
20637
|
}
|
|
20638
20638
|
return Object.defineProperty(t, "version", {
|
|
20639
20639
|
get: function() {
|
|
20640
|
-
return "6.1.
|
|
20640
|
+
return "6.1.5";
|
|
20641
20641
|
},
|
|
20642
20642
|
enumerable: !1,
|
|
20643
20643
|
configurable: !0
|
|
@@ -22187,7 +22187,7 @@ var Yp = 800, qs = 90, $p = function(n) {
|
|
|
22187
22187
|
}
|
|
22188
22188
|
return Object.defineProperty(t, "version", {
|
|
22189
22189
|
get: function() {
|
|
22190
|
-
return "6.1.
|
|
22190
|
+
return "6.1.5";
|
|
22191
22191
|
},
|
|
22192
22192
|
enumerable: !1,
|
|
22193
22193
|
configurable: !0
|