@realsee/five 6.2.3 → 6.2.4

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2024/11/8
5
- * Version: 6.2.3
4
+ * Generated: 2024/11/11
5
+ * Version: 6.2.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1859,7 +1859,7 @@ void main() {
1859
1859
  `,e},t.prototype.updateShaderSource=function(){var e=this.getDefines()+zp,r=this.getDefines()+Dp;this.setValues({vertexShader:e,fragmentShader:r}),this.needsUpdate=!0},Ct([Xt("screenWidth"),Mt("design:type",Number)],t.prototype,"screenWidth",void 0),Ct([Xt("screenHeight"),Mt("design:type",Number)],t.prototype,"screenHeight",void 0),Ct([Xt("edlStrength"),Mt("design:type",Number)],t.prototype,"edlStrength",void 0),Ct([Xt("uNear"),Mt("design:type",Number)],t.prototype,"uNear",void 0),Ct([Xt("uFar"),Mt("design:type",Number)],t.prototype,"uFar",void 0),Ct([Xt("radius"),Mt("design:type",Number)],t.prototype,"radius",void 0),Ct([Xt("neighbours",!0),Mt("design:type",Float32Array)],t.prototype,"neighbours",void 0),Ct([Xt("depthMap"),Mt("design:type",d.Texture)],t.prototype,"depthMap",void 0),Ct([Xt("uEDLColor"),Mt("design:type",d.Texture)],t.prototype,"uEDLColor",void 0),Ct([Xt("uEDLDepth"),Mt("design:type",d.Texture)],t.prototype,"uEDLDepth",void 0),Ct([Xt("uProj"),Mt("design:type",Array)],t.prototype,"uProj",void 0),t}(d.RawShaderMaterial);function Pt(n,t){return{type:n,value:t}}function Xt(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 Up=new d.OrthographicCamera(-1,1,1,-1,0,1),Mo=new d.BufferGeometry;Mo.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Mo.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Lu=new d.Mesh(Mo),Ou=new d.Scene;Ou.add(Lu);var qp=function(n){ue(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 Qp,Lu.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(Ou,Up)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(wo);const Hp=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-
1860
1860
  sy|n-qr}u-J-r\x07r?Q5Qr}uZn}9-b6;Hvs5qr}u-KJ->;=6
1861
1861
  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-
1862
- b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Kp=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:Gp,fragmentShader:Hp})||this;return r.uniforms={uDepthMap:js("t",null),uWeightMap:js("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([Js("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Js("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function js(n,t){return{type:n,value:t}}function Js(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 jp=new d.OrthographicCamera(-1,1,1,-1,0,1),Io=new d.BufferGeometry;Io.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Io.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Vu=new d.Mesh(Io),Nu=new d.Scene;Nu.add(Vu);var Jp=function(n){ue(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 Kp,o.camera=i,Vu.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(Nu,jp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(wo),Ca=.5,Ma=.5,Xs=Math.PI/7,Xp=function(n){ue(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.modelInScreen=a.modelInScreen,r.locationMotion=new Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new qp(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Jp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return L(L({},f),{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",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Di}})},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,p=m.currentState,y=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:p.workCode,panoIndex:p.panoIndex},v=f.getResolvedObserver(y),g=(o=h.fov)!==null&&o!==void 0?o:60,x=fe((s=h.latitude)!==null&&s!==void 0?s:Ga(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,g,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),I=(u=h.longitude)!==null&&u!==void 0?u:Ga(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<b&&v?(w.copy(v.position),h.longitude===void 0&&(I=p.longitude)):w.copy(A.bounding.getCenter(w)),A.bounding.containsPoint(w)||A.bounding.getCenter(w),L(L({},y),{mode:"Mapview",longitude:I,latitude:x,fov:g,offset:w,distance:E})},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(L(L({},this),{initial:{currentState:L(L({},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(D),this.cameraMotion.set(s,i.duration).catch(D),!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(D),a.cameraMotion.set(s,r).catch(D)})},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(D),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(D),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Qt(i)||this.models.setMaterial(i),Qt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Ee())[1],r=this.locationMotion.getKeyFrameSegment(Ee())[1];return L(L({},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(D),e.modelAlphaMotion.set(c,a/3).catch(D),e.cameraMotion.set(l,a).catch(D),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=L(L(L({},e.currentPano),{mode:e.mode}),Je(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,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,A=r.models;f<A.length;f++){var m=A[f];if(m.visible&&((c=m.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=lr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s: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=L({},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=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),m=L(L({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:A,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(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",L(L({},e),{isFirst:r,isFinal:h,state:m}));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(D),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(D),h?this.inMomentumMovement=null:lt.shared.add(function(y,v){o.requestMomentumMovement(e,!1,s,v|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Ot(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=Ca;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var A,m=(A=f.face)===null||A===void 0?void 0:A.normal;return m&&a.ray.direction.dot(m)>=0?!1:f.distance>Ma+a.near})[0],!o)){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})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=fe(o.distance,0,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=Ca,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).normalize(),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 p={x:e.center.x-i.x,y:e.center.y-i.y},y=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),v=Ot(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new d.Vector3().copy(v).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new d.Vector2),b=2*p.x*g/x.y,w=2*p.y*g/x.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),y.add(E),this.camera.pose.latitude<Xs?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),y.add(E),this.modelInScreen==="boundingbox-center"){var I=this.models.bounding.clone();I.expandByScalar(this.camera.pose.distance),y.clamp(I.min,I.max)}var M=L(L({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,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(D),e.isFinal&&(this.fixFinalState(M),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(D)),e.isFinal){var k=this.renderer.getSize(new d.Vector2),B=2*e.velocityX*g/k.y,C=2*e.velocityY*g/k.y,T=new d.Vector3,O=new d.Vector3;T.setFromMatrixColumn(this.camera.matrix,0),T.multiplyScalar(-B),O.add(T),this.camera.pose.latitude<Xs?T.setFromMatrixColumn(this.camera.matrix,1):(T.setFromMatrixColumn(this.camera.matrix,0),T.crossVectors(this.camera.up,T)),T.multiplyScalar(C),O.add(T),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:O.x,y:O.y,z:O.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},P=this.coordinatesForOffset(p),F=Gr(this.cameraMotion.value.longitude+P.longitude),V=fe(this.cameraMotion.value.latitude+P.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(V=this.cameraMotion.value.latitude);var M=L(L({},this.currentPano),{mode:this.mode,longitude:F,latitude:V,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(D):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(D),e.isFinal){var z=e.velocityX,j=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,L(L({},this.coordinatesForOffset({x:z,y:j})),{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(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(Ot(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!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(D),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var A={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(A,0).catch(D)}delete this.panState,delete this.pinchState}}}},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=Ca,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=a.ray.origin.distanceTo(c),A=2*Math.tan(.5*this.camera.fov/180*Math.PI),m=Math.max(f*A/10,1);this.intersectMesh.scale.set(m,m,m);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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(D)}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(Ot(e.state).setLength(l)),c=this.models.bounding.containsPoint(u);if(this.modelInScreen!=="none"&&(l=!c&&a<0&&o.distanceTo(u)>s?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(D)}},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=L(L({},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.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(D),this.hideIntersectMesh()}}},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}(xo);function Ws(n){return n==null}var Wp={type:"move"},_s=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(Wp))),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 p=u.joints[A.jointName];m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=m.radius),p.visible=m!==null}var y=u.joints["index-finger-tip"],v=u.joints["thumb-tip"],g=y.position.distanceTo(v.position),x=.02,b=.005;u.inputState.pinching&&g>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&g<=x-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}(),_p=1,Zp=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:D,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:D,this.controllers=[new _s,new _s],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,p=i/(-f+A),y=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=s+p,g=l+p,x=m-y,b=h+(i-y),w=u*l/g*v,E=c*l/g*v;t.projectionMatrix.makePerspective(x,b,w,E,v,g)},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,lt.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:_p};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}(),So=function(n){ue(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(So.prototype,{isLineSegmentsGeometry:!0});var Ia={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:`
1862
+ b-J-Htyl]|vv|{-J-}|wrpv|{Znv\x07-7-z|qrycvrZnv\x07-7-rpA5}|vv|{9>;=6H\f`);var Kp=function(n){ue(t,n);function t(e){var r=n.call(this,{vertexShader:Gp,fragmentShader:Hp})||this;return r.uniforms={uDepthMap:js("t",null),uWeightMap:js("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([Js("uDepthMap"),Mt("design:type",Number)],t.prototype,"uDepthMap",void 0),Ct([Js("uWeightMap"),Mt("design:type",Number)],t.prototype,"uWeightMap",void 0),t}(d.RawShaderMaterial);function js(n,t){return{type:n,value:t}}function Js(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 jp=new d.OrthographicCamera(-1,1,1,-1,0,1),Io=new d.BufferGeometry;Io.setAttribute("position",new d.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3));Io.setAttribute("uv",new d.Float32BufferAttribute([0,2,0,0,2,0],2));var Vu=new d.Mesh(Io),Nu=new d.Scene;Nu.add(Vu);var Jp=function(n){ue(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 Kp,o.camera=i,Vu.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(Nu,jp)},t.prototype.dispose=function(){this.copyPass.dispose()},t}(wo),Ca=.5,Ma=.5,Xs=Math.PI/7,Xp=function(n){ue(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.modelInScreen=a.modelInScreen,r.locationMotion=new Me({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 Me({modelAlpha:(i=r.models.getMaterial().modelAlpha)!==null&&i!==void 0?i:0}),r.perspToOrthoMotion=new Me({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,{generateMipmaps:!1,minFilter:d.NearestFilter,magFilter:d.NearestFilter,format:d.RGBAFormat,type:d.FloatType,depthTexture:new d.DepthTexture(1024,1024,d.UnsignedIntType)}),r.edlEffect=new qp(r.renderer,r.modelScene,r.camera,r.models),r.hqEffect=new Jp(r.renderer,r.modelScene,r.camera,r.models),r}return t.parseArgs=function(e){var r,i,a,o,s,l,u,c;if(e instanceof t)return e;var f=n.parseArgs.call(this,e);return L(L({},f),{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",modelInScreen:(u=e.modelInScreen)!==null&&u!==void 0?u:"boundingbox-center",intersectMeshCreator:(c=e.intersectMeshCreator)!==null&&c!==void 0?c:function(){return new Di}})},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,p=m.currentState,y=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:p.workCode,panoIndex:p.panoIndex},v=f.getResolvedObserver(y),g=(o=h.fov)!==null&&o!==void 0?o:60,x=fe((s=h.latitude)!==null&&s!==void 0?s:Ga(p.mode)?p.latitude:c.defaultLatitude,c.minLatitude,c.maxLatitude),b=t.distanceFromModel(c.models,g,c.camera.aspect),w=new d.Vector3,E=(l=h.distance)!==null&&l!==void 0?l:Math.min(c.defaultDistance,b),I=(u=h.longitude)!==null&&u!==void 0?u:Ga(p.mode)?p.longitude:c.defaultLongitude;return h.offset?w.copy(h.offset):c.defaultDistance<b&&v?(w.copy(v.position),h.longitude===void 0&&(I=p.longitude)):w.copy(A.bounding.getCenter(w)),A.bounding.containsPoint(w)||A.bounding.getCenter(w),L(L({},y),{mode:"Mapview",longitude:I,latitude:x,fov:g,offset:w,distance:E})},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(L(L({},this),{initial:{currentState:L(L({},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(D),this.cameraMotion.set(s,i.duration).catch(D),!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(D),a.cameraMotion.set(s,r).catch(D)})},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(D),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(D),this.perspToOrthoMotion.ended||(this.perspToOrthoMotion.update(e),this.camera.perspToOrtho.setScalar(fe(this.perspToOrthoMotion.value.perspToOrtho,0,1))),Qt(i)||this.models.setMaterial(i),Qt(a)||this.setCamera(a)}},t.prototype.getTargetState=function(){var e=this.cameraMotion.getKeyFrameSegment(Ee())[1],r=this.locationMotion.getKeyFrameSegment(Ee())[1];return L(L({},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(D),e.modelAlphaMotion.set(c,a/3).catch(D),e.cameraMotion.set(l,a).catch(D),e.locationMotion.set(u,a).then(function(){e.emit("initAnimation.end",X("initAnimation.end",{state:s,userAction:e.userAction}))},function(A){var m=L(L(L({},e.currentPano),{mode:e.mode}),Je(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,i=this.models.intersectRaycaster(e)[0];if(!i)return null;var a=this.works.resolvedObservers.filter(function(u){for(var c,f=0,A=r.models;f<A.length;f++){var m=A[f];if(m.visible&&((c=m.work)===null||c===void 0?void 0:c.workCode)===u.work.workCode)return!0}return!1}),o=lr(a,function(u){return u.standingPosition.distanceTo(i.point)},!0),s=o[0],l=o[1];return s&&l<10?s: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=L({},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=new d.Vector3(this.locationMotion.value.x+l.x,this.locationMotion.value.y+l.y,this.locationMotion.value.z+l.z),m=L(L({},this.currentPano),{mode:this.mode,longitude:c,latitude:f,offset:A,fov:this.cameraMotion.value.fov,distance:this.camera.pose.distance}),h=!(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",L(L({},e),{isFirst:r,isFinal:h,state:m}));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(D),this.locationMotion.set({x:m.offset.x,y:m.offset.y,z:m.offset.z},0).catch(D),h?this.inMomentumMovement=null:lt.shared.add(function(y,v){o.requestMomentumMovement(e,!1,s,v|0)},!0,1))}},t.prototype.fixFinalState=function(e){if(this.perspToOrthoMotion.getTargetKeyframe().value.perspToOrtho!==1){var r=Ot(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=Ca;var o;if(a.ray.direction.y<-.3&&(o=this.models.intersectRaycaster(a).filter(function(f){var A,m=(A=f.face)===null||A===void 0?void 0:A.normal;return m&&a.ray.direction.dot(m)>=0?!1:f.distance>Ma+a.near})[0],!o)){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})}}if(!o){var c=Math.max(e.distance,3);o={distance:c,floor:0,point:a.ray.direction.clone().setLength(c).add(a.ray.origin),object:this.scene,face:null}}o&&(e.distance=fe(o.distance,0,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=Ca,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).normalize(),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 p={x:e.center.x-i.x,y:e.center.y-i.y},y=new d.Vector3(this.locationMotion.value.x,this.locationMotion.value.y,this.locationMotion.value.z),v=Ot(this.cameraMotion.value).setLength(this.locationMotion.value.distance).add(y),g=new d.Vector3().copy(v).sub(i.target).length();g*=Math.tan(this.camera.pose.fov/2*Math.PI/180);var x=this.renderer.getSize(new d.Vector2),b=2*p.x*g/x.y,w=2*p.y*g/x.y,E=new d.Vector3;if(E.setFromMatrixColumn(this.camera.matrix,0),E.multiplyScalar(-b),y.add(E),this.camera.pose.latitude<Xs?E.setFromMatrixColumn(this.camera.matrix,1):(E.setFromMatrixColumn(this.camera.matrix,0),E.crossVectors(this.camera.up,E)),E.multiplyScalar(w),y.add(E),this.modelInScreen==="boundingbox-center"){var I=this.models.bounding.clone();I.expandByScalar(this.camera.pose.distance),y.clamp(I.min,I.max)}var M=L(L({},this.currentPano),{mode:this.mode,longitude:this.camera.pose.longitude,latitude:this.camera.pose.latitude,fov:this.camera.pose.fov,offset:y,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(D),e.isFinal&&(this.fixFinalState(M),Object.assign(e,{__fixFinalState:!0}),this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(D)),e.isFinal){var k=this.renderer.getSize(new d.Vector2),B=2*e.velocityX*g/k.y,C=2*e.velocityY*g/k.y,T=new d.Vector3,O=new d.Vector3;T.setFromMatrixColumn(this.camera.matrix,0),T.multiplyScalar(-B),O.add(T),this.camera.pose.latitude<Xs?T.setFromMatrixColumn(this.camera.matrix,1):(T.setFromMatrixColumn(this.camera.matrix,0),T.crossVectors(this.camera.up,T)),T.multiplyScalar(C),O.add(T),this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,{longitude:0,latitude:0,x:O.x,y:O.y,z:O.z},0)}}else{var p={x:e.center.x-i.x,y:e.center.y-i.y},P=this.coordinatesForOffset(p),F=Gr(this.cameraMotion.value.longitude+P.longitude),V=fe(this.cameraMotion.value.latitude+P.latitude,this.minLatitude,this.maxLatitude);this.camera.aspect<1&&Math.abs(e.overallVelocityX)>.2&&Math.atan2(Math.abs(e.overallVelocityY),Math.abs(e.overallVelocityX))<Math.PI/6.923&&(V=this.cameraMotion.value.latitude);var M=L(L({},this.currentPano),{mode:this.mode,longitude:F,latitude:V,fov:this.camera.pose.fov,offset:this.camera.pose.offset,distance:this.camera.pose.distance});if(e.isFinal&&Object.assign(e,{__fixFinalState:!0}),e.state=M,this.emit("gesture.pan",e),e.defaultPrevented)return;if(e.isFinal?this.locationMotion.set({distance:M.distance,x:M.offset.x,y:M.offset.y,z:M.offset.z},0).catch(D):this.cameraMotion.set({longitude:M.longitude,latitude:M.latitude},0).catch(D),e.isFinal){var z=e.velocityX,j=e.velocityY;this.inMomentumMovement={uuid:wt()},this.requestMomentumMovement(e,!0,L(L({},this.coordinatesForOffset({x:z,y:j})),{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(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(Ot(e.state).setLength(s)),u=this.models.bounding.containsPoint(l),c;if(!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(D),e.pointerType!=="mouse"&&(e.type="gesture.pan",this.onPanGesture(e)),e.isFinal)){if(!("__fixFinalState"in e)){var f=e.state;this.fixFinalState(e.state);var A={x:f.offset.x,y:f.offset.y,z:f.offset.z,distance:f.distance};this.locationMotion.set(A,0).catch(D)}delete this.panState,delete this.pinchState}}}},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=Ca,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=a.ray.origin.distanceTo(c),A=2*Math.tan(.5*this.camera.fov/180*Math.PI),m=Math.max(f*A/10,1);this.intersectMesh.scale.set(m,m,m);var h=c.clone().add(u);if(this.intersectMesh.lookAt(h),Math.abs(l.y)>.99){var p=this.camera.position.clone().sub(c);this.intersectMesh.rotation.z=-Math.atan2(p.z,p.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(D)}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(Ot(e.state).setLength(l)),c=this.models.bounding.containsPoint(u);if(this.modelInScreen!=="none"&&(l=!c&&a<0&&o.distanceTo(u)>s?e.state.distance:l),e.state.distance=l,this.emit("gesture.mousewheel",e),e.defaultPrevented)return;this.locationMotion.set({distance:l},0).catch(D)}},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=L(L({},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.onDblTapGesture=function(e){if(this.initAnimationIsReady){this.userAction=e.userAction,this.stopMomentumMovement(),this.hideIntersectMesh();var r=e.state,i=e.center.raycaster,a=i.ray.origin.clone().add(i.ray.direction.clone().setLength(3)),o=1,s=3,l=o,u=this.models.intersectRaycaster(i)[0];if(u&&(a=u.point.clone(),u.distance>(o+s)/2?l=o:l=s),e.state.distance=l,e.state.offset=a,this.emit("gesture.dbltap",e),!e.defaultPrevented){var c={x:r.offset.x,y:r.offset.y,z:r.offset.z,distance:r.distance};this.locationMotion.set(c,360).catch(D),this.hideIntersectMesh()}}},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}(xo);function Ws(n){return n==null}var Wp={type:"move"},_s=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(Wp))),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 p=u.joints[A.jointName];m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=m.radius),p.visible=m!==null}var y=u.joints["index-finger-tip"],v=u.joints["thumb-tip"],g=y.position.distanceTo(v.position),x=.02,b=.005;u.inputState.pinching&&g>x+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&g<=x-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}(),_p=1,Zp=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:D,this.onSessionEndCallback=(l=r==null?void 0:r.onSessionEnd)!==null&&l!==void 0?l:D,this.controllers=[new _s,new _s],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,p=i/(-f+A),y=p*-f;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(y),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=s+p,g=l+p,x=m-y,b=h+(i-y),w=u*l/g*v,E=c*l/g*v;t.projectionMatrix.makePerspective(x,b,w,E,v,g)},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,lt.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:_p};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({baseLayer: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}(),So=function(n){ue(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(So.prototype,{isLineSegmentsGeometry:!0});var Ia={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:`
1863
1863
  #include <common>
1864
1864
  #include <color_pars_vertex>
1865
1865
  #include <fog_pars_vertex>
@@ -2058,7 +2058,7 @@ void main() {
2058
2058
  #include <premultiplied_alpha_fragment>
2059
2059
 
2060
2060
  }
2061
- `},To=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(Ia.uniforms),vertexShader:Ia.vertexShader,fragmentShader:Ia.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(To.prototype,{isLineMaterial:!0});var zu=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new So,i.material=r!==void 0?r:new To({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,p=new d.Vector4,y=new d.Vector3,v=new d.Matrix4,g=new d.Line3,x=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,y.copy(p);var b=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(A,w),m.w=1,h.w=1,m.applyMatrix4(v),h.applyMatrix4(v),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var I=m.z<-1&&h.z<-1,M=m.z>1&&h.z>1;if(!(I||M)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,g.start.copy(m),g.start.z=0,g.end.copy(h),g.end.z=0;var k=g.closestPointToPointParameter(y,!0);g.at(k,x);var B=d.MathUtils.lerp(m.z,h.z,k),C=B>=-1&&B<=1,T=y.distanceTo(x)<c*.5;if(C&&T){g.start.fromBufferAttribute(f,w),g.end.fromBufferAttribute(A,w),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(g.start,g.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(zu.prototype,{isLineSegments2:!0});var Du=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(zu);Object.assign(Du.prototype,{isLine2:!0});var Qu=function(n){ue(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}(So);Object.assign(Qu.prototype,{isLineGeometry:!0});var Yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Zs=14467195,$p=8,ev=2,tv=20,Ys=null,Wa=function(n){ue(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 Qu,o=new To({color:Zs,linewidth:ev,dashScale:tv,dashed:!1});i.line=new Du(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:Zs,size:$p,map:Ys||(Ys=new d.TextureLoader().load(Yp)),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.2.3"},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(Wa.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 Uu(n){return Oi(this,void 0,void 0,function(){var t;return Vi(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 rv(n){return Oi(this,void 0,void 0,function(){var t,e;return Vi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Uu("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function nv(n,t){return Oi(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),Vi(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,rv(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,Uu(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 iv={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function av(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 ov=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(iv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=av(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}(),sv=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 ov(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=L({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}(),uv=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 sv(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}(),lv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",cv="generic-trigger",dv=function(n){ue(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}(zn.Object3D);function fv(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 zn.SphereGeometry(.001),s=new zn.MeshBasicMaterial({color:255}),l=new zn.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 $s(n,t){fv(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 hv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=lv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new dv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||nv(o,e.path,cv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new uv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),$s(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(),$s(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function pv(n,t){return n}var e0=300,vv=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),t0=new d.Vector3(-1,1,1),Av=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Zp(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 Wa,right:new Wa},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 hv;o.gltfLoader={load:function(l,u){Mi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return lo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Mi})}).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:ze(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=lt.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=L(L({},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 L(L({},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=Kn(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,p=function(C,T){return pv(rn(C,h,T))},y=L({key:"pano.".concat(f.panoId)},Vt(this.imageOptions,["format","size","quality"])),v=f.images,g=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>m}))!==null&&l!==void 0?l:null,x="pano:"+ho([v,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)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}))}var w=this.models.getMaterial()||{},E=w.pano0,I=w.pano1,M;if((E==null?void 0:E.map.name)===x?M=E:(I==null?void 0:I.map.name)===x&&(M=I),M){var k={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,t0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,k,r);return}var B="move-to-pano-"+f.panoId;this.pending.add(B),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(C){if(a.pending.delete(B),a.destroyed)C.body.dispose();else{C.body.name=x;var T={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,t0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,T,r)}},onError:function(C){a.pending.delete(B);var T=L(L(L({},f.pano),{mode:a.mode}),Je(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:T})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:T})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(v,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:y},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(C){var T,O;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano})),((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:y},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(C){var T,O;((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano}))},this.renderer)]).then(function(C){var T,O,P=C[0];((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(C){var T,O;((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&(a.pendingTextureTask.onError(C),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:f.pano})),a.emit("error",C))}),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,p;i===void 0&&(i={});var y=Ee(),v=wt();this.panoResources[v]=r;var g=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(y);E[0];var I=E[1],M=this.locationMotion.value,k=this.panoResourceFromLocationMotionKeyframe(I).position,B=r.position;x=Math.max(k.distanceTo(B),g),b=[{key:I.key,progress:0,value:L(L({},M),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(y),T=C[0],I=C[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(T).position,k=this.panoResourceFromLocationMotionKeyframe(I).position,B=r.position,P=I.value.count-M.count,F=Math.max(O.distanceTo(k),g)*P,V=Math.max(k.distanceTo(B),g);x=F+V,b=[{key:T.key,progress:0,value:L({},M)},{key:I.key,progress:F/x,value:I.value},{key:v,progress:1,value:{count:I.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),j=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(y)*z/j}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},q=L(L({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=H.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:q,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(q),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=D,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(H,K).catch(D);else{var G=Ot({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=Ot({longitude:(u=H.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),_=new d.Object3D;_.lookAt(G);var Y=new d.Matrix4().makeRotationFromQuaternion(_.quaternion);_.lookAt(W);var oe=new d.Matrix4().makeRotationFromQuaternion(_.quaternion),$=new d.Matrix4().getInverse(Y).premultiply(oe),ae=this.cameraMotion.value.fov,ne=(f=H.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var ie=ne*le,ge=0;ge<b.length-1;ge++){var he=b[ge].key;if(he){var ve=this.panoResources[he];ve&&(ve.fixCameraTransform.copy($),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan(ie/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=H.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=H.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:ne}}],K).catch(D)}var Re=this.locationMotion.setKeyframes(b,K,w);Re.then(function(){for(var Ce,Te,ee,re=0,Q=a.models;re<Q.length;re++){var Ve=Q[re];Ve.show()}var ke=L(L({},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:ke,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ke);var Se=a.works.getResolvedObserver(a.currentPano);if(Se&&Se.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=vv.clone().multiply((ee=(Te=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&ee!==void 0?ee:new d.Matrix4).multiply(Se.video.matrix),be={map:a.videoTexture,size:Se.video.size,matrix:Ge,alpha:1},ye=wt(),me=a.videoTexture.image;me.setAttribute("uuid",ye),Pu().then(function(Ae){Ae&&Se.video&&me.getAttribute("uuid")===ye&&(me.oncanplay=function(){me.oncanplay=D,me.play()},me.ontimeupdate=function(){me.currentTime>.5&&(me.ontimeupdate=D,a.panoVideo.setMaterial(be))},me.src=Se.video.source)}).catch(function(){me.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:q,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(W){var _=vt(W);if(Zt(_,r.currentPano))return!1;var Y=r.works.getResolvedObserver(_);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=lr(f,function(W){var _=r.works.getResolvedObserver(W);if(!_)return 1/0;var Y=_.standingPosition.clone();return Y.distanceTo(A.point)},!0),h=m[0],p=m[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(Ws(u)){var y=this.getForwardObserverOrNot(e);y&&(u=y)}for(var v=0,g=this.locationMotion.keyframes;v<g.length;v++){var x=g[v],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(Ws(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var I=Math.PI/6,M=Math.PI/12,k=new d.Vector3(0,1,0),B=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=B.clone().applyAxisAngle(k,I),T=B.clone().applyAxisAngle(k,-I),O=[],P=[],F=[],V=0,z=u.accessibleIds;V<z.length;V++){var h=z[V],j=vt(h);if(!(Zt(j,this.currentPano)||Zt(j,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var H=K.position.clone().sub(u.position).setY(0);B.angleTo(H)<I?F.push(H):C.angleTo(H)<I?O.push(H):T.angleTo(H)<I&&P.push(H)}}}var q=F.length>0?F:bt(bt([],O,!0),P,!0),J=q.slice().sort(function(W,_){return W.angleTo(B)-_.angleTo(B)})[0];J&&J.angleTo(l)>M&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var G={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.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:G,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:G,options:E,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 p={},y={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.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),w=b[0],E=b[1],I=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),k=new d.Vector3().copy(I.position),B=new d.Vector3().copy(M.position),C=this.locationMotion.value.count-E.value.count+1;p.progress=C,M.leftPanoPicture&&(C<1?I.leftPanoPicture&&(p.pano0=I.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&M.effect!=="fly"&&(p.pano0&&I.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:I.leftPanoPicture.matrix.clone().setPosition(M.position)}),k.copy(B),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(k.x+(B.x-k.x)*C,k.y+(B.y-k.y)*C,k.z+(B.z-k.z)*C);for(var T=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],z=V.key,j=V.progress;z!==void 0&&(T.push(z),j>this.locationMotion.progress&&O.push(z))}for(var K=0,H=Object.keys(this.panoResources);K<H.length;K++){var q=H[K];if(!(O.indexOf(q)>=0)){var J=this.panoResources[q];if(J.leftPanoPicture){var G=J.leftPanoPicture.map;if(G){if(G===((a=p.pano0)===null||a===void 0?void 0:a.map)||G===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;G instanceof Ne&&G.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(G.cubeRenderTarget),G.dispose(),J.leftPanoPicture=null}}T.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=vt(M.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:vt(v.panoId),state:L(L(L(L({},vt(g.panoId)),{mode:this.mode}),Je(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Qt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Qt(y)===!1&&this.setCamera(y);var W=this.works.getResolvedObserver(this.currentPano),_=m[1];if(!_){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var oe=this.xrManager.cameraVR,$=this.xrManager.cameraL,ae=this.xrManager.cameraR,ne=[$,ae],le=_.getViewerPose(Y),ie=new d.Vector3(0,0,0);if(le){var ge;ge=this.xrManager.session.renderState.baseLayer;var he=le.views;if(!ge){console.error("no layer found");return}this.renderer.setFramebuffer(ge.framebuffer);var ve=!1;he.length!==oe.cameras.length&&(oe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Ce=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(Re,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(Re).normalize();var Te=new d.Vector3,ee=new d.Quaternion,re=new d.Vector3;this.camera.matrix.decompose(Te,ee,re);for(var Q=0;Q<he.length;Q++){var Ve=he[Q],ke=ge.getViewport(Ve),Se=ne[Q];Se.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ye=new d.Vector3;Se.matrix.decompose(Ge,be,ye),ie.copy(Te),Se.position.copy(Te),Se.quaternion.copy(be),Se.scale.copy(ye),Se.updateMatrix(),Se.projectionMatrix.fromArray(Ve.projectionMatrix),Se.viewport.set(ke.x,ke.y,ke.width,ke.height),ve===!0&&oe.cameras.push(Se)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var Q=0;Q<this.xrManager.session.inputSources.length;Q++)if(this.xrManager.session.inputSources[Q]&&this.xrManager.session.inputSources[Q].targetRayMode==="transient-pointer"){var me=_.getPose(this.xrManager.session.inputSources[Q].targetRaySpace,Y);if(me){var Ae=new d.Vector3(0,0,-1).applyQuaternion(me.transform.orientation),pe=new d.Raycaster(this.camera.position,Ae);this.gazeRay=pe}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,Q=0;Q<Qe.length;Q++){var Ke=this.xrManager.controllers[Q],rt=Qe[Q];if(rt){Ke&&Ke.update(rt,_,Y);var pe=this.xrManager.getController(Q),Kr=new d.Vector3(0,1.2,0),Fe=pe.position.clone().add(ie).sub(Kr);rt.handedness==="left"?this.xrControllerRay.left.set(Fe,new d.Vector3(0,0,-1).applyEuler(pe.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(Fe,new d.Vector3(0,0,-1).applyEuler(pe.rotation)),this.controllerWrappers[Q].position.copy(new d.Vector3(0,0,0).add(ie).sub(Kr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Xr;return L({floor:(Xr=W==null?void 0:W.floorIndex)!==null&&Xr!==void 0?Xr:0},Ir)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),$t=Ze[0].face.normal,un=$t.clone(),er=Ze[0].point.clone();this.intersectMesh.position.copy(er);var St=er.clone().add(un);if(this.intersectMesh.lookAt(St),Math.abs($t.y)>.99){var tr=this.camera.position.clone().sub(er);this.intersectMesh.rotation.z=-Math.atan2(tr.z,tr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Fe,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Fe,Ze[0].point));var Cr=Ze[0],Ut=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",Ut),Ut.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Fe,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||x)for(var rr=0,qt=Object.keys(this.panoMeshes);rr<qt.length;rr++){var ct=qt[rr],Le=this.panoMeshes[ct];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(W){var dr=lr(W.visibleIds,function(dt){var Kt=i.works.getResolvedObserver(dt);return Kt?W.standingPosition.distanceTo(Kt.standingPosition):1/0},!0),At=dr[1];At=fe(At,2.5,1/0);for(var fr=W.visibleIds.concat(ze(this.currentPano)),hr=this.getForwardObserverOrNot(),Ht=this.camera.getDirection(new d.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var ct=pr[Et],Le=this.panoMeshes[ct],Mr=this.works.getResolvedObserver(ct);if(fr.indexOf(ct)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Mr)Le.setCurrent(!1),Le.setOpacity(0);else if(!Mr.loadable&&!Mr.active)Le.setCurrent(!1),Le.setOpacity(0);else{var ln=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&hr!==null&&hr.panoId===ct),Le.setOpacity(ln<.01?0:fe(At/ln*1.2,.65,.98));var jr=this.camera.position.clone().setY(Le.position.y),Ae=new d.Vector3().copy(Le.position).sub(jr).normalize();if(ct===ze(this.currentPano)){var Jr=fe((.5-jr.distanceTo(Le.position))/.5,0,1);Ae.multiplyScalar(1-Jr).add(Ht.clone().multiplyScalar(Jr))}Ae.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Gt=function(){return 4}(),Ye=function(){var dt=new d.PerspectiveCamera;dt.applyMatrix4(oe.matrix),dt.position.set(0,0,0);var Kt=i.works.getResolvedObserver(g.panoId),Ir=Kt!=null?Kt:W;Ir&&dt.quaternion.premultiply(Ir.quaternion.clone().inverse()),dt.updateProjectionMatrix(),dt.updateMatrixWorld(!0);var Xr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(dt.projectionMatrix,dt.matrixWorldInverse));return Xr}();g.panoId===ze(this.currentPano)&&((c=g.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update(Ye,Gt),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var nt=g.panoId,mt=this.works.getResolvedObserver(nt);mt?ri(this.camera.position,mt.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=mt.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&mt.images.luminance?mt.images.luminance:null),this.tiling.setFetcher(it(mt.work)),this.tiling.setRotation(mt.quaternion),this.tiling.setPosition(mt.position),this.tiling.maxRequest=this.tileMaxRequest,Gt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Gt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==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>e0&&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<=e0){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}(Co),Bt={Floorplan:Xa,Topview:qh,Panorama:Co,VRPanorama:Op,Model:Np,Mapview:Xp,XRPanorama:Av},qu=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function mv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Ot(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 gv(){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 r0(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 yv(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 Hu(){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=yv((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const bv="data:image/png;base64,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";var n0=[351,63],i0=[20,20],xv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),wv=new Float32Array([0,0,1,0,0,1,1,1]),Ev=new Uint8Array([0,1,2,1,3,2]),qi=new d.BufferGeometry;qi.setAttribute("position",new d.BufferAttribute(xv,3));qi.setAttribute("uv",new d.BufferAttribute(wv,2));qi.setIndex(new d.BufferAttribute(Ev,1));var Ei=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Gu=new d.Mesh(qi,Ei);Gu.matrixAutoUpdate=!1;var Po=new d.Scene;Po.add(Gu);Po.matrixAutoUpdate=!1;var ni=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);ni.position.set(0,0,.5);ni.lookAt(0,0,0);ni.updateMatrixWorld(!0);ni.matrixAutoUpdate=!1;var Cv=new d.Vector4,Mv=new d.Vector4;function Iv(n){if(Ei.map){var r=n.getViewport(Cv),i=n.getScissor(Mv),a=n.getScissorTest(),o=n.autoClear,s=i.x+i0[0]/3,l=i.y+i0[1]/3,u=n0[0]/3,c=n0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Po,ni),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,Ei.needsUpdate=!0,e.onload=D},e.src=bv,Ei.map=t}}var Sv=800,a0=90,Tv=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/")},Pv=new d.Vector2,pi=new d.Frustum,vi=new d.Matrix4,o0=new WeakMap,Sa=new WeakMap,s0=Ha([]),Ku=function(n){ue(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"&&(_a.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=L({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=L({},(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:Ee()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:Sv,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.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=Hu();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(B){B instanceof Error&&h.throwError(B)}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,generateMipmaps:!1});var y=new d.DepthTexture(1,1);y.generateMipmaps=!1,y.format=d.DepthStencilFormat,y.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:y,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new zi(a0),h.scene=new S0,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:Tv,h.networkSubscribe=new v0,h.networkSubscribe.on("network",function(B,C,T,O){var P;h.emit("network.resource",X("network.resource",{source:B,requestType:C,requestState:T,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,B,C,T,O)}),h.boundingMesh=Ih(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Ps(),h.models.push(new Ka),h.lastModels=Ps(),h.lastWorks=Ha([]),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||gv()),r0(h.scene),r0(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=lt.shared.add(function(B,C){for(var T=[],O=2;O<arguments.length;O++)T[O-2]=arguments[O];h.updateTime.apply(h,bt([B,C],T,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],I=w[1],M=w[2];if(typeof E=="function"){var k=E(h,M);typeof I=="string"&&(h.plugins[I]?h.throwError(new Error("plugin name ".concat(I," is exists."))):h.plugins[I]=k)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,mv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.3"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Bi.decoderPath},set:function(e){Bi.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 Dt)){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:`
2061
+ `},To=function(n){ue(t,n);function t(e){var r=n.call(this,{uniforms:d.UniformsUtils.clone(Ia.uniforms),vertexShader:Ia.vertexShader,fragmentShader:Ia.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(To.prototype,{isLineMaterial:!0});var zu=function(n){ue(t,n);function t(e,r){var i=n.call(this)||this;return i.type="LineSegments2",i.geometry=e!==void 0?e:new So,i.material=r!==void 0?r:new To({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,p=new d.Vector4,y=new d.Vector3,v=new d.Matrix4,g=new d.Line3,x=new d.Vector3;i.at(1,p),p.w=1,p.applyMatrix4(a.matrixWorldInverse),p.applyMatrix4(o),p.multiplyScalar(1/p.w),p.x*=u.x/2,p.y*=u.y/2,p.z=0,y.copy(p);var b=this.matrixWorld;v.multiplyMatrices(a.matrixWorldInverse,b);for(var w=0,E=f.count;w<E;w++){m.fromBufferAttribute(f,w),h.fromBufferAttribute(A,w),m.w=1,h.w=1,m.applyMatrix4(v),h.applyMatrix4(v),m.applyMatrix4(o),h.applyMatrix4(o),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w);var I=m.z<-1&&h.z<-1,M=m.z>1&&h.z>1;if(!(I||M)){m.x*=u.x/2,m.y*=u.y/2,h.x*=u.x/2,h.y*=u.y/2,g.start.copy(m),g.start.z=0,g.end.copy(h),g.end.z=0;var k=g.closestPointToPointParameter(y,!0);g.at(k,x);var B=d.MathUtils.lerp(m.z,h.z,k),C=B>=-1&&B<=1,T=y.distanceTo(x)<c*.5;if(C&&T){g.start.fromBufferAttribute(f,w),g.end.fromBufferAttribute(A,w),g.start.applyMatrix4(b),g.end.applyMatrix4(b);var O=new d.Vector3,P=new d.Vector3;i.distanceSqToSegment(g.start,g.end,P,O),r.push({point:P,pointOnLine:O,distance:i.origin.distanceTo(P),object:this,faceIndex:w})}}}},t}(d.Mesh);Object.assign(zu.prototype,{isLineSegments2:!0});var Du=function(n){ue(t,n);function t(e,r){var i=n.call(this,e,r)||this;return i.type="Line2",i}return t}(zu);Object.assign(Du.prototype,{isLine2:!0});var Qu=function(n){ue(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}(So);Object.assign(Qu.prototype,{isLineGeometry:!0});var Yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg==",Zs=14467195,$p=8,ev=2,tv=20,Ys=null,Wa=function(n){ue(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 Qu,o=new To({color:Zs,linewidth:ev,dashScale:tv,dashed:!1});i.line=new Du(a,o);var s=new d.BufferGeometry,l=new d.PointsMaterial({color:Zs,size:$p,map:Ys||(Ys=new d.TextureLoader().load(Yp)),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.2.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(Wa.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 Uu(n){return Oi(this,void 0,void 0,function(){var t;return Vi(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 rv(n){return Oi(this,void 0,void 0,function(){var t,e;return Vi(this,function(r){switch(r.label){case 0:if(!n)throw new Error("No basePath supplied");return t="profilesList.json",[4,Uu("".concat(n,"/").concat(t))];case 1:return e=r.sent(),[2,e]}})})}function nv(n,t){return Oi(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),Vi(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,rv(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,Uu(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 iv={xAxis:0,yAxis:0,button:0,state:Xe.ComponentState.DEFAULT};function av(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 ov=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(iv)}return n.prototype.updateFromComponent=function(t){var e=t.xAxis,r=t.yAxis,i=t.button,a=t.state,o=av(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}(),sv=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 ov(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=L({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}(),uv=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 sv(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}(),lv="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",cv="generic-trigger",dv=function(n){ue(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}(zn.Object3D);function fv(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 zn.SphereGeometry(.001),s=new zn.MeshBasicMaterial({color:255}),l=new zn.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 $s(n,t){fv(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 hv=function(){function n(t){t===void 0&&(t=null),this.gltfLoader=t,this.path=lv,this._assetCache={}}return n.prototype.createControllerModel=function(t){var e=this,r=new dv,i=null;return t.addEventListener("connected",function(a){var o=a.data;o.targetRayMode!=="tracked-pointer"||!o.gamepad||nv(o,e.path,cv).then(function(s){var l=s.profile,u=s.assetPath;r.motionController=new uv(o,l,u);var c=e._assetCache[r.motionController.assetUrl];if(c)i=c.scene.clone(),$s(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(),$s(r,i)})}}).catch(function(s){console.warn(s)})}),t.addEventListener("disconnected",function(){r.motionController=null,r.remove(i),i=null}),r},n}();function pv(n,t){return n}var e0=300,vv=new d.Matrix4().makeRotationAxis(new d.Vector3(0,1,0),Math.PI),t0=new d.Vector3(-1,1,1),Av=function(n){ue(t,n);function t(e){var r=n.call(this,e)||this;r.xrManager=new Zp(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 Wa,right:new Wa},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 hv;o.gltfLoader={load:function(l,u){Mi.ajax(l,{responseType:"arraybuffer"}).then(function(c){var f;return lo(c.body,{resourcePath:l.slice(0,l.lastIndexOf("/")+1),search:(f=l.split("?")[1])!==null&&f!==void 0?f:"",fetcher:Mi})}).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:ze(r.currentPano),leftPanoPicture:null,position:r.camera.pose.offset.clone(),effect:"fade",fixCameraTransform:new d.Matrix4},r.parallaxCameraMatrixs=[];var s=lt.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=L(L({},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 L(L({},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=Kn(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,p=function(C,T){return pv(rn(C,h,T))},y=L({key:"pano.".concat(f.panoId)},Vt(this.imageOptions,["format","size","quality"])),v=f.images,g=(l=(s=f.images.tiles)===null||s===void 0?void 0:s.filter(function(C){return C.size>m}))!==null&&l!==void 0?l:null,x="pano:"+ho([v,y,h]);if(this.pendingTextureTask){if(this.pendingTextureTask.hash===x)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}))}var w=this.models.getMaterial()||{},E=w.pano0,I=w.pano1,M;if((E==null?void 0:E.map.name)===x?M=E:(I==null?void 0:I.map.name)===x&&(M=I),M){var k={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:M.map,luminanceMap:M.luminanceMap,matrix:new d.Matrix4().compose(f.position,f.quaternion,t0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};this.doMoveToPano(f.pano,k,r);return}var B="move-to-pano-"+f.panoId;this.pending.add(B),this.pendingTextureTask={panoId:f.panoId,hash:x,onLoad:function(C){if(a.pending.delete(B),a.destroyed)C.body.dispose();else{C.body.name=x;var T={panoId:f.panoId,effect:c,leftPanoPicture:{zoom:1,map:C.body,luminanceMap:null,matrix:new d.Matrix4().compose(f.position,f.quaternion,t0)},position:f.position.clone(),fixCameraTransform:new d.Matrix4};a.doMoveToPano(f.pano,T,r)}},onError:function(C){a.pending.delete(B);var T=L(L(L({},f.pano),{mode:a.mode}),Je(a.camera.pose));a.emit("pano.error",X("pano.error",{error:C,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:T})),a.emit("pano.cancel",X("pano.cancel",{error:null,userAction:a.userAction,options:r,prevPano:a.currentPano,progress:0,state:T})),r.moveCancelCallback&&r.moveCancelCallback()}},Promise.all([this.tileLevelForFov&&g&&g.length?this.textureLoader.loadTiledCubeTexture(v,g,{tileMaxLevel:this.TILED_CUBE_TEXTURE_LEVEL,imageURL:{transform:p,options:y},format:d.RGBAFormat,minFilter:d.LinearFilter,magFilter:d.LinearFilter,generateMipmaps:!1,viaAjax:!0,fetcher:it(f.work)},void 0,void 0,function(C){var T,O;a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano})),((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(C))},this.renderer):this.textureLoader.loadCubeTexture(v,{imageURL:{transform:p,options:y},format:d.RGBAFormat,fetcher:it(f.work)},void 0,void 0,function(C){var T,O;((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&((O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(C)),a.emit("pano.texture.progress",X("pano.texture.progress",{error:null,progress:C,meta:null,pano:f.pano}))},this.renderer)]).then(function(C){var T,O,P=C[0];((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x?(a.pendingTextureTask.onLoad(P),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.success",X("pano.texture.success",{error:null,progress:1,meta:P.meta,pano:f.pano}))):P.body.dispose()}).catch(function(C){var T,O;((T=a.pendingTextureTask)===null||T===void 0?void 0:T.hash)===x&&(a.pendingTextureTask.onError(C),(O=a.panoMeshes[f.panoId])===null||O===void 0||O.setProgress(0),delete a.pendingTextureTask,a.emit("pano.texture.error",X("pano.texture.error",{error:C,progress:0,meta:null,pano:f.pano})),a.emit("error",C))}),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,p;i===void 0&&(i={});var y=Ee(),v=wt();this.panoResources[v]=r;var g=1,x,b,w;if(this.locationMotion.ended){var E=this.locationMotion.getKeyFrameSegment(y);E[0];var I=E[1],M=this.locationMotion.value,k=this.panoResourceFromLocationMotionKeyframe(I).position,B=r.position;x=Math.max(k.distanceTo(B),g),b=[{key:I.key,progress:0,value:L(L({},M),{count:0})},{key:v,progress:1,value:{distance:0,count:1}}],w=0}else{var C=this.locationMotion.getKeyFrameSegment(y),T=C[0],I=C[1],M=this.locationMotion.value,O=this.panoResourceFromLocationMotionKeyframe(T).position,k=this.panoResourceFromLocationMotionKeyframe(I).position,B=r.position,P=I.value.count-M.count,F=Math.max(O.distanceTo(k),g)*P,V=Math.max(k.distanceTo(B),g);x=F+V,b=[{key:T.key,progress:0,value:L({},M)},{key:I.key,progress:F/x,value:I.value},{key:v,progress:1,value:{count:I.value.count+1,distance:0}}];var z=this.locationMotionKeyframesLength(this.locationMotion.keyframes),j=this.locationMotionKeyframesLength(b);w=this.locationMotion.getProgressVelocity(y)*z/j}var K=r.effect==="instant"?0:this.calculateMovingDuration(i.duration,r.effect==="fly"?x:0),H={longitude:i.longitude,latitude:i.latitude,fov:i.fov},q=L(L({},e),{mode:this.mode,longitude:(o=H.longitude)!==null&&o!==void 0?o:this.camera.pose.longitude,latitude:(s=H.latitude)!==null&&s!==void 0?s:this.camera.pose.latitude,fov:(l=H.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:q,userAction:this.userAction,error:null})),i.moveStartCallback&&i.moveStartCallback(q),this.videoTexture&&this.videoTexture.image instanceof HTMLVideoElement&&this.videoTexture.image.getAttribute("src")&&(this.videoTexture.image.pause(),this.videoTexture.image.removeAttribute("uuid"),this.videoTexture.image.removeAttribute("src"),this.videoTexture.image.oncanplay=D,this.videoTexture.needsUpdate=!0),this.panoVideo.setMaterial(null),r.effect==="fly")this.cameraMotion.set(H,K).catch(D);else{var G=Ot({longitude:this.cameraMotion.value.longitude,latitude:this.cameraMotion.value.latitude}),W=Ot({longitude:(u=H.longitude)!==null&&u!==void 0?u:this.cameraMotion.value.longitude,latitude:(c=H.latitude)!==null&&c!==void 0?c:this.cameraMotion.value.latitude}),_=new d.Object3D;_.lookAt(G);var Y=new d.Matrix4().makeRotationFromQuaternion(_.quaternion);_.lookAt(W);var oe=new d.Matrix4().makeRotationFromQuaternion(_.quaternion),$=new d.Matrix4().getInverse(Y).premultiply(oe),ae=this.cameraMotion.value.fov,ne=(f=H.fov)!==null&&f!==void 0?f:this.cameraMotion.value.fov,le=1;r.effect==="zoomin"?le=1.5:r.effect==="zoomout"&&(le=.4);for(var ie=ne*le,ge=0;ge<b.length-1;ge++){var he=b[ge].key;if(he){var ve=this.panoResources[he];ve&&(ve.fixCameraTransform.copy($),ve.leftPanoPicture&&(ve.leftPanoPicture.zoom=Math.tan(ae/2/180*Math.PI)/Math.tan(ie/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=H.longitude)!==null&&A!==void 0?A:this.cameraMotion.value.longitude,latitude:(m=H.latitude)!==null&&m!==void 0?m:this.cameraMotion.value.latitude,fov:ie}},{progress:1,value:{longitude:(h=H.longitude)!==null&&h!==void 0?h:this.cameraMotion.value.longitude,latitude:(p=H.latitude)!==null&&p!==void 0?p:this.cameraMotion.value.latitude,fov:ne}}],K).catch(D)}var Re=this.locationMotion.setKeyframes(b,K,w);Re.then(function(){for(var Ce,Te,ee,re=0,Q=a.models;re<Q.length;re++){var Ve=Q[re];Ve.show()}var ke=L(L({},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:ke,userAction:a.userAction,error:null})),i.moveEndCallback&&i.moveEndCallback(ke);var Se=a.works.getResolvedObserver(a.currentPano);if(Se&&Se.video&&a.videoTexture&&a.videoTexture.image instanceof HTMLVideoElement){var Ge=vv.clone().multiply((ee=(Te=(Ce=a.models.getMaterial())===null||Ce===void 0?void 0:Ce.pano1)===null||Te===void 0?void 0:Te.matrix)!==null&&ee!==void 0?ee:new d.Matrix4).multiply(Se.video.matrix),be={map:a.videoTexture,size:Se.video.size,matrix:Ge,alpha:1},ye=wt(),me=a.videoTexture.image;me.setAttribute("uuid",ye),Pu().then(function(Ae){Ae&&Se.video&&me.getAttribute("uuid")===ye&&(me.oncanplay=function(){me.oncanplay=D,me.play()},me.ontimeupdate=function(){me.currentTime>.5&&(me.ontimeupdate=D,a.panoVideo.setMaterial(be))},me.src=Se.video.source)}).catch(function(){me.removeAttribute("uuid")})}},function(){a.emit("pano.cancel",X("pano.cancel",{options:i,prevPano:J,progress:0,state:q,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(W){var _=vt(W);if(Zt(_,r.currentPano))return!1;var Y=r.works.getResolvedObserver(_);return!Y||Y.position.distanceTo(r.camera.position)>r.maxAccessibleDistance?!1:Y.loadable||Y.active}),A=this.models.intersectRaycaster(e)[0];if(A){var m=lr(f,function(W){var _=r.works.getResolvedObserver(W);if(!_)return 1/0;var Y=_.standingPosition.clone();return Y.distanceTo(A.point)},!0),h=m[0],p=m[1];h&&p<this.panoTapTriggerRadius&&(u=(i=this.works.getResolvedObserver(h))!==null&&i!==void 0?i:null)}if(Ws(u)){var y=this.getForwardObserverOrNot(e);y&&(u=y)}for(var v=0,g=this.locationMotion.keyframes;v<g.length;v++){var x=g[v],b=this.panoResourceFromLocationMotionKeyframe(x);if(!(x.progress<this.locationMotion.progress)&&u&&b.panoId===u.panoId){u=null;break}}if(Ws(u))return this.locationMotion.ended===!0&&this.cameraBounce(),null;if(u&&!u.active){var w=u.panoId;this.panoMeshes[w]&&(this.panoMeshes[w].setDisabled(!1),this.panoMeshes[w].setLoading(!0))}var E={};if(u){for(var I=Math.PI/6,M=Math.PI/12,k=new d.Vector3(0,1,0),B=u.position.clone().setY(0).sub(c.position.clone().setY(0)).normalize(),C=B.clone().applyAxisAngle(k,I),T=B.clone().applyAxisAngle(k,-I),O=[],P=[],F=[],V=0,z=u.accessibleIds;V<z.length;V++){var h=z[V],j=vt(h);if(!(Zt(j,this.currentPano)||Zt(j,u.pano))){var K=this.works.getResolvedObserver(h);if(K){var H=K.position.clone().sub(u.position).setY(0);B.angleTo(H)<I?F.push(H):C.angleTo(H)<I?O.push(H):T.angleTo(H)<I&&P.push(H)}}}var q=F.length>0?F:bt(bt([],O,!0),P,!0),J=q.slice().sort(function(W,_){return W.angleTo(B)-_.angleTo(B)})[0];J&&J.angleTo(l)>M&&(E.longitude=Math.atan2(-J.x,-J.z))}this.cameraMotion.value.latitude<-Math.PI/4&&(E.latitude=fe(0,this.minLatitude,this.maxLatitude)),this.cameraMotion.value.fov<60&&(E.fov=this.defaultFov);var G={workCode:u.pano.workCode,panoIndex:u.pano.panoIndex,mode:this.mode,longitude:(a=E.longitude)!==null&&a!==void 0?a:this.camera.pose.longitude,latitude:(o=E.latitude)!==null&&o!==void 0?o:this.camera.pose.latitude,fov:(s=E.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:G,userAction:!0,options:E,progress:0,error:null})),u&&u.active?(this.emit("pano.request",X("pano.request",{userAction:!0,prevPano:this.currentPano,progress:0,state:G,options:E,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 p={},y={},v=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[0]),g=this.panoResourceFromLocationMotionKeyframe(this.locationMotion.keyframes[this.locationMotion.keyframes.length-1]),x=!1;if(this.cameraMotion.ended===!1&&(this.cameraMotion.update(e),y.longitude=this.cameraMotion.value.longitude,y.latitude=this.cameraMotion.value.latitude,y.fov=this.cameraMotion.value.fov),this.modelAlphaMotion.ended===!1&&(this.modelAlphaMotion.update(e),p.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),w=b[0],E=b[1],I=this.panoResourceFromLocationMotionKeyframe(w),M=this.panoResourceFromLocationMotionKeyframe(E),k=new d.Vector3().copy(I.position),B=new d.Vector3().copy(M.position),C=this.locationMotion.value.count-E.value.count+1;p.progress=C,M.leftPanoPicture&&(C<1?I.leftPanoPicture&&(p.pano0=I.leftPanoPicture):p.pano0=M.leftPanoPicture,p.pano1=M.leftPanoPicture),M.effect==="montage"?p.transition="BLACK":M.effect==="spread"?p.transition="SPREAD":p.transition="FADE",(M.effect==="zoomin"||M.effect==="zoomout")&&(p.progress=Math.pow(C,3)),C<1&&M.effect!=="fly"&&(p.pano0&&I.leftPanoPicture&&(p.pano0={map:p.pano0.map,zoom:p.pano0.zoom,luminanceMap:p.pano0.luminanceMap,matrix:I.leftPanoPicture.matrix.clone().setPosition(M.position)}),k.copy(B),x=!0),y.distance=this.locationMotion.value.distance,y.offset=new d.Vector3(k.x+(B.x-k.x)*C,k.y+(B.y-k.y)*C,k.z+(B.z-k.z)*C);for(var T=[],O=[],P=0,F=this.locationMotion.keyframes;P<F.length;P++){var V=F[P],z=V.key,j=V.progress;z!==void 0&&(T.push(z),j>this.locationMotion.progress&&O.push(z))}for(var K=0,H=Object.keys(this.panoResources);K<H.length;K++){var q=H[K];if(!(O.indexOf(q)>=0)){var J=this.panoResources[q];if(J.leftPanoPicture){var G=J.leftPanoPicture.map;if(G){if(G===((a=p.pano0)===null||a===void 0?void 0:a.map)||G===((o=p.pano1)===null||o===void 0?void 0:o.map))continue;G instanceof Ne&&G.cubeRenderTarget&&this.colorCubeRenderTargetPool.push(G.cubeRenderTarget),G.dispose(),J.leftPanoPicture=null}}T.indexOf(q)>=0||delete this.panoResources[q]}}this.currentPano=vt(M.panoId),this.emit("pano.moving",X("pano.moving",{userAction:this.userAction,prevPano:vt(v.panoId),state:L(L(L(L({},vt(g.panoId)),{mode:this.mode}),Je(this.camera.pose)),y),options:{},progress:this.locationMotion.progress,error:null}))}Qt(p)===!1&&(!((s=p.pano0)===null||s===void 0)&&s.map&&p.pano0.map instanceof Ne&&!p.pano0.map.cubeRenderTarget&&(p.pano0.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),!((l=p.pano1)===null||l===void 0)&&l.map&&p.pano1.map instanceof Ne&&!p.pano1.map.cubeRenderTarget&&(p.pano1.map.cubeRenderTarget=this.colorCubeRenderTargetPool.pop()),this.models.setMaterial(p)),Qt(y)===!1&&this.setCamera(y);var W=this.works.getResolvedObserver(this.currentPano),_=m[1];if(!_){console.error("xrFrame丢失,请重试");return}if(!this.xrManager.session){console.error("session丢失,请重试");return}var Y=this.xrManager.referenceSpace;if(Y){var oe=this.xrManager.cameraVR,$=this.xrManager.cameraL,ae=this.xrManager.cameraR,ne=[$,ae],le=_.getViewerPose(Y),ie=new d.Vector3(0,0,0);if(le){var ge;ge=this.xrManager.session.renderState.baseLayer;var he=le.views;if(!ge){console.error("no layer found");return}this.renderer.setFramebuffer(ge.framebuffer);var ve=!1;he.length!==oe.cameras.length&&(oe.cameras.length=0,ve=!0),this.parallaxCameraMatrixs=[];var Re=new d.Vector3,Ce=new d.Vector3;new d.Matrix4().fromArray(he[0].transform.matrix).decompose(Re,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(Re).normalize();var Te=new d.Vector3,ee=new d.Quaternion,re=new d.Vector3;this.camera.matrix.decompose(Te,ee,re);for(var Q=0;Q<he.length;Q++){var Ve=he[Q],ke=ge.getViewport(Ve),Se=ne[Q];Se.matrix.fromArray(Ve.transform.matrix);var Ge=new d.Vector3,be=new d.Quaternion,ye=new d.Vector3;Se.matrix.decompose(Ge,be,ye),ie.copy(Te),Se.position.copy(Te),Se.quaternion.copy(be),Se.scale.copy(ye),Se.updateMatrix(),Se.projectionMatrix.fromArray(Ve.projectionMatrix),Se.viewport.set(ke.x,ke.y,ke.width,ke.height),ve===!0&&oe.cameras.push(Se)}if(this.xrManager.session&&this.xrManager.session.inputSources){for(var Q=0;Q<this.xrManager.session.inputSources.length;Q++)if(this.xrManager.session.inputSources[Q]&&this.xrManager.session.inputSources[Q].targetRayMode==="transient-pointer"){var me=_.getPose(this.xrManager.session.inputSources[Q].targetRaySpace,Y);if(me){var Ae=new d.Vector3(0,0,-1).applyQuaternion(me.transform.orientation),pe=new d.Raycaster(this.camera.position,Ae);this.gazeRay=pe}}}if(this.xrManager.machineType==="Oculus"||this.xrManager.machineType==="Pico"){for(var Qe=this.xrManager.session.inputSources,Q=0;Q<Qe.length;Q++){var Ke=this.xrManager.controllers[Q],rt=Qe[Q];if(rt){Ke&&Ke.update(rt,_,Y);var pe=this.xrManager.getController(Q),Kr=new d.Vector3(0,1.2,0),Fe=pe.position.clone().add(ie).sub(Kr);rt.handedness==="left"?this.xrControllerRay.left.set(Fe,new d.Vector3(0,0,-1).applyEuler(pe.rotation)):rt.handedness==="right"&&this.xrControllerRay.right.set(Fe,new d.Vector3(0,0,-1).applyEuler(pe.rotation)),this.controllerWrappers[Q].position.copy(new d.Vector3(0,0,0).add(ie).sub(Kr));var Ze=this.models.intersectRaycaster(this.xrControllerRay.right);if(Ze.length===0&&(Ze=this.xrControllerRay.right.intersectObject(this.boundingMesh,!0).map(function(Ir){var Xr;return L({floor:(Xr=W==null?void 0:W.floorIndex)!==null&&Xr!==void 0?Xr:0},Ir)})),Ze.length>=1&&Ze[0].face)if(rt.handedness==="right"){var ot=this.xrControllerRay.right.intersectObject(this.xrCustomObjectsScene,!0),$t=Ze[0].face.normal,un=$t.clone(),er=Ze[0].point.clone();this.intersectMesh.position.copy(er);var St=er.clone().add(un);if(this.intersectMesh.lookAt(St),Math.abs($t.y)>.99){var tr=this.camera.position.clone().sub(er);this.intersectMesh.rotation.z=-Math.atan2(tr.z,tr.x)}this.intersectMesh.visible=!0,this.needsRender=!0,ot.length>0?(this.pointerLines.right.setPoints(Fe,ot[0].point),this.pointerLines.right.points.visible=!0,this.intersectMesh.visible=!1):(this.pointerLines.right.points.visible=!1,this.pointerLines.right.setPoints(Fe,Ze[0].point));var Cr=Ze[0],Ut=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",Ut),Ut.defaultPrevented){this.hideIntersectMesh();return}}else this.pointerLines.left.setPoints(Fe,Ze[0].point)}}this.updateControllerHelper(Qe,e,r)}if(this.camera.pose.distance>.1||x)for(var rr=0,qt=Object.keys(this.panoMeshes);rr<qt.length;rr++){var ct=qt[rr],Le=this.panoMeshes[ct];Le.setOpacity(0),Le.setCurrent(!1),Le.updateTime&&Le.updateTime(e,r),Le.visible=!1}else if(W){var dr=lr(W.visibleIds,function(dt){var Kt=i.works.getResolvedObserver(dt);return Kt?W.standingPosition.distanceTo(Kt.standingPosition):1/0},!0),At=dr[1];At=fe(At,2.5,1/0);for(var fr=W.visibleIds.concat(ze(this.currentPano)),hr=this.getForwardObserverOrNot(),Ht=this.camera.getDirection(new d.Vector3),Et=0,pr=Object.keys(this.panoMeshes);Et<pr.length;Et++){var ct=pr[Et],Le=this.panoMeshes[ct],Mr=this.works.getResolvedObserver(ct);if(fr.indexOf(ct)===-1)Le.setCurrent(!1),Le.setOpacity(0);else if(!Mr)Le.setCurrent(!1),Le.setOpacity(0);else if(!Mr.loadable&&!Mr.active)Le.setCurrent(!1),Le.setOpacity(0);else{var ln=Le.position.clone().setY(this.camera.position.y).distanceTo(this.camera.position);Le.setCurrent(!Le.loading&&Le.progress===0&&hr!==null&&hr.panoId===ct),Le.setOpacity(ln<.01?0:fe(At/ln*1.2,.65,.98));var jr=this.camera.position.clone().setY(Le.position.y),Ae=new d.Vector3().copy(Le.position).sub(jr).normalize();if(ct===ze(this.currentPano)){var Jr=fe((.5-jr.distanceTo(Le.position))/.5,0,1);Ae.multiplyScalar(1-Jr).add(Ht.clone().multiplyScalar(Jr))}Ae.length()>0&&Le.quaternion.setFromEuler(new d.Euler(0,Math.atan2(Ae.x,Ae.z),0))}Le.updateTime&&Le.updateTime(e,r)}}var Gt=function(){return 4}(),Ye=function(){var dt=new d.PerspectiveCamera;dt.applyMatrix4(oe.matrix),dt.position.set(0,0,0);var Kt=i.works.getResolvedObserver(g.panoId),Ir=Kt!=null?Kt:W;Ir&&dt.quaternion.premultiply(Ir.quaternion.clone().inverse()),dt.updateProjectionMatrix(),dt.updateMatrixWorld(!0);var Xr=new d.Frustum().setFromProjectionMatrix(new d.Matrix4().multiplyMatrices(dt.projectionMatrix,dt.matrixWorldInverse));return Xr}();g.panoId===ze(this.currentPano)&&((c=g.leftPanoPicture)===null||c===void 0?void 0:c.map)instanceof Ne&&(g.leftPanoPicture.map.maxRequest=this.tileMaxRequest,g.leftPanoPicture.map.update(Ye,Gt),g.leftPanoPicture.map.needsRender===!0&&(this.needsRender=!0,this.modelSceneNeedsRender=!0));{var qe=this.tiling.object.visible;if(this.initAnimationed){var nt=g.panoId,mt=this.works.getResolvedObserver(nt);mt?ri(this.camera.position,mt.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=mt.images)===null||f===void 0?void 0:f.tiles)!==null&&A!==void 0?A:[],this.enableIOSEDR&&mt.images.luminance?mt.images.luminance:null),this.tiling.setFetcher(it(mt.work)),this.tiling.setRotation(mt.quaternion),this.tiling.setPosition(mt.position),this.tiling.maxRequest=this.tileMaxRequest,Gt>this.TILED_CUBE_TEXTURE_LEVEL?this.tiling.update(Ye,Gt,e):this.tiling.update(Ye,0,e)):this.tiling.object.visible=!1:this.tiling.object.visible=!1}else this.tiling.object.visible=!1;qe!==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>e0&&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<=e0){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}(Co),Bt={Floorplan:Xa,Topview:qh,Panorama:Co,VRPanorama:Op,Model:Np,Mapview:Xp,XRPanorama:Av},qu=["gesture.pan","gesture.tap","gesture.dbltap","gesture.press","gesture.pinch","gesture.mousewheel","gesture.mousemove","gesture.momentum","initAnimation.start","initAnimation.end","camera.update","intersect.update","pano.select","pano.moveTo","pano.moving","pano.arrived","pano.cancel","pano.error","pano.texture.load","pano.texture.progress","pano.texture.success","pano.texture.error","pano.texture.abort","xr.session.start","xr.session.end","xr.gesture.tap","xr.gesture.press","xr.gesture.buttonUp","xr.gesture.buttonDown","xr.controller.update"];function mv(n){n.on("initAnimation.start",function(t){n.emit("initAnimationWillStart",t.state.panoIndex,t.state,t.userAction)}),n.on("initAnimation.end",function(t){n.emit("initAnimationEnded",t.state.panoIndex,t.state,t.userAction)}),n.on("gesture.pan",function(t){var e=!1;e=n.emit("wantsGesture","pan",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPanGesture",t.state,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pan",t.pointers,t.isFinal),n.emit("panGesture",t.state,t.isFinal))}),n.on("gesture.tap",function(t){var e=!1;e=n.emit("wantsGesture","tap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","tap",t.pointers,t.isFinal),n.emit("tapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.dbltap",function(t){var e=!1;e=n.emit("wantsGesture","dbltap",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsDblTapGesture",t.center.raycaster,t.center.coords,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","dbltap",t.pointers,t.isFinal),n.emit("dblTapGesture",t.center.raycaster,t.center.coords,t.isFinal))}),n.on("gesture.press",function(t){var e=!1;e=n.emit("wantsGesture","press",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","press",t.pointers,t.isFinal),n.emit("pressGesture",t.center.raycaster,t.center.coords,t.center.delta,t.isFinal))}),n.on("gesture.pinch",function(t){var e=!1;e=n.emit("wantsGesture","pinch",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsPinchGesture",t.scale,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","pinch",t.pointers,t.isFinal),n.emit("pinchGesture",t.scale,t.state.fov,t.isFinal))}),n.on("gesture.mousewheel",function(t){var e=!1;e=n.emit("wantsGesture","mouseWheel",t.pointers,t.isFinal),e&&t.preventDefault(),e=n.emit("wantsMouseWheel",t.center.delta,t.state.fov,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseWheel",t.pointers,t.isFinal),n.emit("mouseWheel",t.center.delta,t.state.fov,t.isFinal))}),n.on("gesture.mousemove",function(t){var e=!1;e=n.emit("wantsGesture","mouseMove",t.pointers,t.isFinal),e&&t.preventDefault(),t.defaultPrevented||(n.emit("gesture","mouseMove",t.pointers,t.isFinal),e=n.emit("wantsChangeCameraFov",t.state.fov),e&&t.preventDefault())}),n.on("gesture.momentum",function(t){var e=!1;e=n.emit("wantsInteriaPan",t.state),e&&t.preventDefault(),t.defaultPrevented||n.emit("interiaPan",t.state,t.isFinal)}),n.on("camera.update",function(t){n.emit("cameraFovUpdate",t.state.fov,t.userAction),n.emit("cameraDirectionUpdate",t.state,t.userAction);var e=Ot(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 gv(){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 r0(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 yv(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 Hu(){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=yv((n=r.getAttribute("content"))!==null&&n!==void 0?n:""),a=Number(i["initial-scale"]);if(!isNaN(a))return a}}return 1}const bv="data:image/png;base64,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";var n0=[351,63],i0=[20,20],xv=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),wv=new Float32Array([0,0,1,0,0,1,1,1]),Ev=new Uint8Array([0,1,2,1,3,2]),qi=new d.BufferGeometry;qi.setAttribute("position",new d.BufferAttribute(xv,3));qi.setAttribute("uv",new d.BufferAttribute(wv,2));qi.setIndex(new d.BufferAttribute(Ev,1));var Ei=new d.MeshBasicMaterial({transparent:!0,depthTest:!1,depthWrite:!1,stencilWrite:!1,fog:!1}),Gu=new d.Mesh(qi,Ei);Gu.matrixAutoUpdate=!1;var Po=new d.Scene;Po.add(Gu);Po.matrixAutoUpdate=!1;var ni=new d.OrthographicCamera(-.5,.5,.5,-.5,.1,1);ni.position.set(0,0,.5);ni.lookAt(0,0,0);ni.updateMatrixWorld(!0);ni.matrixAutoUpdate=!1;var Cv=new d.Vector4,Mv=new d.Vector4;function Iv(n){if(Ei.map){var r=n.getViewport(Cv),i=n.getScissor(Mv),a=n.getScissorTest(),o=n.autoClear,s=i.x+i0[0]/3,l=i.y+i0[1]/3,u=n0[0]/3,c=n0[1]/3;n.setViewport(s,l,u,c),n.setScissor(s,l,u,c),n.setScissorTest(!0),n.autoClear=!1,n.render(Po,ni),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,Ei.needsUpdate=!0,e.onload=D},e.src=bv,Ei.map=t}}var Sv=800,a0=90,Tv=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/")},Pv=new d.Vector2,pi=new d.Frustum,vi=new d.Matrix4,o0=new WeakMap,Sa=new WeakMap,s0=Ha([]),Ku=function(n){ue(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"&&(_a.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=L({},(i=e.imageOptions)!==null&&i!==void 0?i:{}),h.textureOptions=L({},(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:Ee()},h.info=null,h.modeChangeDuration=(s=e.modeChangeDuration)!==null&&s!==void 0?s:Sv,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.webgl2,logarithmicDepthBuffer:e.logarithmicDepthBuffer,precision:e.precision});var p=Hu();h.renderer.setPixelRatio(p===1?window.devicePixelRatio:1),h.renderer.setSize(512,512)}catch(B){B instanceof Error&&h.throwError(B)}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,generateMipmaps:!1});var y=new d.DepthTexture(1,1);y.generateMipmaps=!1,y.format=d.DepthStencilFormat,y.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:y,generateMipmaps:!1,depthBuffer:!0,stencilBuffer:!0}),h.scissor=Object.assign({left:0,bottom:0,width:1,height:1},e.scissor),h.camera=new zi(a0),h.scene=new S0,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:Tv,h.networkSubscribe=new v0,h.networkSubscribe.on("network",function(B,C,T,O){var P;h.emit("network.resource",X("network.resource",{source:B,requestType:C,requestState:T,detail:O})),(P=h.analysis)===null||P===void 0||P.network(h.works,B,C,T,O)}),h.boundingMesh=Ih(new d.Box3(new d.Vector3(-.5,-.5,-.5),new d.Vector3(.5,.5,.5))),h.boundingMesh.name="bounding",h.models=Ps(),h.models.push(new Ka),h.lastModels=Ps(),h.lastWorks=Ha([]),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||gv()),r0(h.scene),r0(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=lt.shared.add(function(B,C){for(var T=[],O=2;O<arguments.length;O++)T[O-2]=arguments[O];h.updateTime.apply(h,bt([B,C],T,!1))},!1,0,10));var v=function(){typeof document!="undefined"&&document.fullscreenElement===null&&h.currentMode==="VRPanorama"&&h.controller.emit("vr.requestExit",X("vr.requestExit",{}))},g=function(){h.needsRender=!0,h.modelSceneNeedsRender=!0};if(typeof document!="undefined"&&document.addEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.addEventListener("webglcontextrestored",g,!1),h.removeEventListeners=function(){typeof document!="undefined"&&document.removeEventListener("fullscreenchange",v,!1),h.renderer&&h.renderer.domElement.removeEventListener("webglcontextrestored",g,!1)},h.plugins={},e.plugins&&e.plugins.length)for(var x=0,b=e.plugins;x<b.length;x++){var w=b[x];if(typeof w=="function")w(h);else if(Array.isArray(w)){var E=w[0],I=w[1],M=w[2];if(typeof E=="function"){var k=E(h,M);typeof I=="string"&&(h.plugins[I]?h.throwError(new Error("plugin name ".concat(I," is exists."))):h.plugins[I]=k)}}}return h.gpuPickingRenderTarget=new d.WebGLRenderTarget(1,1,{generateMipmaps:!1}),h.meshReplaceMaterialMap=new Map,h.meshOriginMaterialMap=new Map,mv(h),h}return Object.defineProperty(t,"version",{get:function(){return"6.2.4"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"dracoPath",{get:function(){return Bi.decoderPath},set:function(e){Bi.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 Dt)){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:`
2062
2062
  void main() {
2063
2063
  vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
2064
2064
  gl_Position = projectionMatrix * mvPosition;
package/five/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2024/11/8
5
- * Version: 6.2.3
4
+ * Generated: 2024/11/11
5
+ * Version: 6.2.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -20581,7 +20581,7 @@ var Gp = { type: "move" }, js = (
20581
20581
  e.session.updateRenderState({ baseLayer: new XRWebGLLayer(e.session, e.gl, i) });
20582
20582
  break;
20583
20583
  case "Oculus":
20584
- e.session.updateRenderState({ layers: [new XRWebGLLayer(e.session, e.gl, i)] });
20584
+ e.session.updateRenderState({ baseLayer: new XRWebGLLayer(e.session, e.gl, i) });
20585
20585
  break;
20586
20586
  default:
20587
20587
  e.machineType;
@@ -21062,7 +21062,7 @@ var Jp = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA
21062
21062
  }
21063
21063
  return Object.defineProperty(t, "version", {
21064
21064
  get: function() {
21065
- return "6.2.3";
21065
+ return "6.2.4";
21066
21066
  },
21067
21067
  enumerable: !1,
21068
21068
  configurable: !0
@@ -22622,7 +22622,7 @@ var Cv = 800, t0 = 90, Mv = function(n) {
22622
22622
  }
22623
22623
  return Object.defineProperty(t, "version", {
22624
22624
  get: function() {
22625
- return "6.2.3";
22625
+ return "6.2.4";
22626
22626
  },
22627
22627
  enumerable: !1,
22628
22628
  configurable: !0