@realsee/vreo 0.2.0-alpha.13 → 0.2.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +13 -2
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/Player.AudioLike.html +2 -2
  4. package/docs/classes/Player.Controller.html +3 -3
  5. package/docs/classes/Player.Player-1.html +3 -3
  6. package/docs/classes/Player.VideoAgentMesh.html +11 -11
  7. package/docs/classes/Player.VideoAgentScene.html +1 -1
  8. package/docs/demo/assets/{AppReact.388465e9.js → AppReact.2978a2aa.js} +1 -1
  9. package/docs/demo/assets/default.0c3b245d.js +64 -0
  10. package/docs/demo/assets/{default.0350c336.css → default.70243c83.css} +1 -1
  11. package/docs/demo/assets/dynamic.37c058ac.js +1 -0
  12. package/docs/demo/assets/{examples.02abaf01.js → examples.4104efd4.js} +2 -2
  13. package/docs/demo/assets/{index.485f13f7.js → index.863d264e.js} +1 -1
  14. package/docs/demo/assets/{main.0b6b41ab.js → main.f8c52f62.js} +1 -1
  15. package/docs/demo/assets/{react.b14dadc7.js → react.98c8f46f.js} +2 -2
  16. package/docs/demo/assets/{vendor.d3e0753c.js → vendor.f4c5cb32.js} +67 -68
  17. package/docs/demo/examples.html +4 -4
  18. package/docs/demo/index-react-dynamic.html +6 -6
  19. package/docs/demo/index-react.html +6 -6
  20. package/docs/demo/index.html +5 -5
  21. package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
  22. package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
  23. package/docs/enums/Player.PanoEffectEnum.html +1 -1
  24. package/docs/enums/Player.PanoTagEnum.html +1 -1
  25. package/docs/enums/Player.PanoTagStyleEnum.html +2 -2
  26. package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
  27. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  28. package/docs/enums/fivePlugins.Rotation.html +1 -1
  29. package/docs/index.html +10 -3
  30. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
  31. package/docs/interfaces/Player.PlayerConfigs.html +2 -2
  32. package/docs/interfaces/Player.Vertex.html +1 -1
  33. package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
  34. package/docs/interfaces/Player.VreoKeyframe.html +1 -1
  35. package/docs/interfaces/Player.VreoUnit.html +1 -1
  36. package/docs/interfaces/Player.VreoVideo.html +1 -1
  37. package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
  38. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  39. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
  40. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  41. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  42. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  43. package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
  44. package/docs/interfaces/react.VreoActionCallbacks.html +6 -6
  45. package/docs/interfaces/react.VreoProviderProps.html +1 -1
  46. package/docs/modules/Player.html +17 -15
  47. package/docs/modules/custom.html +1 -1
  48. package/docs/modules/fivePlugins.html +5 -2
  49. package/docs/modules/react.html +1 -1
  50. package/lib/Player/custom/SpatialScenePanel/index.js +2 -2
  51. package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +12 -0
  52. package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +26 -10
  53. package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +1 -0
  54. package/lib/Player/modules/VideoAgent/VideoAgentScene.js +1 -2
  55. package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
  56. package/lib/Player/modules/keyframes/PanoTextLabel/index.js +96 -43
  57. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
  58. package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +12 -0
  59. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
  60. package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +32 -0
  61. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
  62. package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +11 -0
  63. package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
  64. package/lib/fivePlugins/CSS3DRenderPlugin/index.js +275 -0
  65. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
  66. package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +18 -0
  67. package/lib/typings/VreoUnit.d.ts +11 -0
  68. package/package.json +1 -1
  69. package/resources/Player/custom/SpatialScenePanel/index.tsx +4 -4
  70. package/resources/Player/index.tsx +1 -1
  71. package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +17 -2
  72. package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +2 -4
  73. package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +87 -34
  74. package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
  75. package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
  76. package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
  77. package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
  78. package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
  79. package/resources/typings/VreoUnit.ts +13 -1
  80. package/stylesheets/default.css +5 -1
  81. package/docs/demo/assets/default.f03f1cdd.js +0 -64
  82. package/docs/demo/assets/dynamic.3f7479e4.js +0 -1
@@ -1,64 +0,0 @@
1
- var we=Object.defineProperty;var be=(e,t,n)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>(be(e,typeof t!="symbol"?t+"":t,n),n);import{r as g,S as J,m as re,o as U,b as N,d as ie,e as Ie,E as Pe,T as Te,F as H,j as f,f as C,a as M,V as T,g as se,L as $,h as ae,i as Ae,B as Ee,k as K,M as Ce,D as Me,l as ue,n as ce,q as ke,s as Le,t as Q,C as Se,v as Fe,w as S,p as V,P as Re,x as Ue,y as Ve,z as ze,O as Be,W as Ne,A as X,G as Y}from"./vendor.d3e0753c.js";const $e=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerpolicy&&(s.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?s.credentials="include":o.crossorigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}};$e();const D=window.requestAnimationFrame||(e=>setTimeout(e,16)),De=window.cancelAnimationFrame||clearTimeout;function le(e,t=0){t<=0?D(e):D(()=>le(e,t-1))}function O(e,t=60){let n=-1,r=0,o=-1;const s=1e3/t;function u(a){o===-1&&(o=a),n=D(u),!(a-r<s)&&(r=a,e&&e(a-o))}return n=D(u),function(){De(n)}}class Oe extends J{constructor(){super();w(this,"$five");w(this,"configs");w(this,"videoAgentScene");w(this,"vreoUnit");w(this,"stopInterval");w(this,"playing",!1);w(this,"visible",!1);w(this,"popUp",null);w(this,"drawerConfig",null);re(this,{visible:U,setVisible:N,playing:U,setPlaying:N,popUp:U.ref,openPopUp:N,drawerConfig:U.ref,openDrawer:N}),ie(()=>this.playing,t=>{this.emit(t?"playing":"paused")})}get isAudio(){var t,n;return!((n=(t=this.videoAgentScene)==null?void 0:t.videoAgentMesh.videoUrl)==null?void 0:n.endsWith(".mp4"))}openPopUp(t){if(!t){this.popUp=null;return}this.popUp=t}setVisible(t){this.visible=t}setPlaying(t){this.playing=t}openDrawer(t){var n;if(!t){this.drawerConfig={content:"",height:(n=this.drawerConfig)==null?void 0:n.height};return}this.drawerConfig=t}get ready(){return!!this.videoAgentScene}get currentTime(){var t;return((t=this.videoAgentScene)==null?void 0:t.videoAgentMesh.currentTime)||0}get currentKeyframes(){return this.vreoUnit?this.vreoUnit.keyframes.filter(n=>{if(n.parsed)return!1;const r=this.currentTime-n.start;return r<=100&&r>=0}):[]}get videoInstance(){var t;return(t=this.videoAgentScene)==null?void 0:t.videoAgentMesh.videoInstance}requestAnimationFrameLoop(t){var r,o,s,u;if((r=this.videoInstance)==null?void 0:r.ended){this.setPlaying(!1),this.videoInstance.pause();return}if(!this.playing){((o=this.videoInstance)==null?void 0:o.paused)||(s=this.videoInstance)==null||s.pause();return}((u=this.videoInstance)==null?void 0:u.paused)&&this.playing&&this.videoInstance.play(),this.currentKeyframes.forEach(a=>{a.parsed||(a.parsed=!0,this.emit(a.type,a),t&&t(a.type,a))})}run(t){this.stopInterval||(this.stopInterval=O(()=>this.requestAnimationFrameLoop(t)))}dispose(){this.setPlaying(!1),this.currentKeyframes&&this.currentKeyframes.forEach(t=>t.parsed=!1),this.vreoUnit=void 0,this.videoInstance&&(this.videoInstance.currentTime=0),this.stopInterval&&(this.stopInterval(),this.stopInterval=void 0)}}const de=g.exports.createContext(null);function E(){const e=Ie.useContext(de);if(!e)throw new Error('\u6CA1\u6709\u627E\u5230 "ControllerContext"');return e}function F(){const e=E();if(!e.$five)throw new Error('\u6CA1\u6709\u627E\u5230 "five" \u5B9E\u4F8B');return e.$five}function Z(){const e=F();return t=>e.project2d(t,!1)}var j;(function(e){e.Move="Move",e.Rotate="Rotate"})(j||(j={}));var L;(function(e){e.Clockwise="Clockwise",e.Anticlockwise="Anticlockwise",e.Loop="Loop"})(L||(L={}));const fe=Pe;function je(e,t,n,r=fe.Linear.None){const o=new Te(e).to(t,n).easing(r);le(()=>o.start(0));const s=O(a=>{o.update(a)===!1&&s()}),u=[];return o.onDestroy=a=>(u.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=u.shift();)a();s()},o}function qe(e,t){return je({progress:0},{progress:1},e,t)}const q=Math.PI*2;function pe(e){return e%q}function me(e){return(e%q+q)%q}const ee=(e,t,n)=>{const r=Math.PI,o=r*2;return e=me(e),t=me(t),n===L.Anticlockwise&&e<t&&(e+=o),n===L.Clockwise&&t<e&&(t+=o),n===L.Loop&&t-e>r?ee(e,t,L.Anticlockwise):n===L.Loop&&e-t>r?ee(e,t,L.Clockwise):{from:e,to:t}};function te(e,t,n){return e+(t-e)*n}const _e=e=>{const t=(o,s,u={preload:!0})=>new Promise(async(a,p)=>{if(u.asyncStartCallback&&u.asyncStartCallback(),e.panoIndex===void 0)return p(!1);if(o.mode&&o.mode!==e.currentMode&&await new Promise(d=>{!o.mode||(e.once("modeChange",i=>{e.once("initAnimationEnded",()=>{i===o.mode&&d(!0)})}),e.changeMode(o.mode,{fov:o.fov||void 0,latitude:o.latitude||void 0,longitude:o.longitude||void 0,panoIndex:o.panoIndex||void 0}))}),o.mode===H.Mode.Floorplan||(u.preload&&o.panoIndex!==void 0&&o.panoIndex!==e.panoIndex&&await e.preloadPano(o.panoIndex),u.asyncEndCallback&&u.asyncEndCallback(),o.panoIndex===void 0&&o.fov===void 0&&o.latitude===void 0&&o.longitude===void 0))return a(!0);const l=o.panoIndex!==void 0?o.panoIndex:e.panoIndex;if(l!==void 0){const d=Object.assign(o,{duration:s,moveEndCallback:()=>a(!0),moveCancelCallback:()=>{a(!0)}});await e.moveToPano(l,d)}else p(!1)}),n=o=>{const s=e.state,u=pe(s.latitude),a=pe(o.latitude),{from:p,to:l}=ee(s.longitude,o.longitude,o.rotation||L.Loop),d=s.fov,i=o.fov;return{from:{latitude:u,longitude:p,fov:d},to:{latitude:a,longitude:l,fov:i}}};return{move:t,rotate:async(o,s,u={})=>{u.asyncStartCallback&&u.asyncStartCallback(),o.mode&&e.currentMode!==o.mode&&await e.changeMode(o.mode),o.mode===H.Mode.Panorama&&e.currentMode===H.Mode.Panorama&&o.panoIndex!==void 0&&o.panoIndex!==e.panoIndex&&(u.preload&&await e.preloadPano(o.panoIndex),await new Promise((l,d)=>{e.moveToPano(o.panoIndex,{moveEndCallback:()=>l(!0),moveCancelCallback:()=>d(!1),effect:"fade"})})),u.asyncEndCallback&&u.asyncEndCallback();const{from:a,to:p}=n(o);return await new Promise((l,d)=>{const i=({progress:h})=>{const b={};b.longitude=te(a.longitude,p.longitude,h),b.latitude=te(a.latitude,p.latitude,h),b.fov=te(a.fov,p.fov,h),e.setState(b,!0)},v=()=>{l(!0)},x=()=>{l(!1)},c=o.rotateSpeed?Math.ceil(Math.abs(p.longitude-a.longitude)/o.rotateSpeed*1e3):s,m=qe(c,fe.Linear.None).onUpdate(i).onComplete(v).onDestroy(x);o.rotation===L.Loop&&m.repeat(1/0).yoyo(!0),setTimeout(()=>{m.destroy(),l(!0)},s)})}}};var I;(function(e){e.CameraMovement="CameraMovement",e.PanoTag="PanoTag",e.PanoTextLabel="PanoTextLabel",e.Prompter="Prompter",e.UpdateVRPanorama="UpdateVRPanorama",e.ModelVideo="ModelVideo",e.PanoEffect="PanoEffect",e.InfoPanel="InfoPanel",e.VideoEffect="VideoEffect",e.BgMusic="BgMusic",e.Exit="Exit",e.Custom="Custom"})(I||(I={}));var z;(function(e){e.Text="Text",e.Image="Image"})(z||(z={}));var _;(function(e){e.Growth="Growth",e.Expand="Expand"})(_||(_={}));var he;(function(e){e.Distance="Distance"})(he||(he={}));var R;(function(e){e.Image="Image",e.Video="Video"})(R||(R={}));var ne;(function(e){e.Drawer="Drawer",e.PopUp="PopUp"})(ne||(ne={}));function We(){const e=E(),t=F(),n=g.exports.useRef();return g.exports.useEffect(()=>{const r=async o=>{n.current||(n.current=_e(t));const{start:s,end:u,data:a}=o,p=a,l=p.effect;l===j.Rotate?await n.current.rotate(a,u-s):l===j.Move?await n.current.move(a,u-s):p.panoIndex!==void 0&&p.panoIndex!==t.panoIndex?await n.current.move(a,u-s):await n.current.rotate(a,u-s)};return e.on(I.CameraMovement,r),()=>{e.off(I.CameraMovement,r)}},[e]),f(C,{})}function ve({url:e,children:t}){return M("div",{className:"vreo-infoPanel vreo-infoPanel--img",children:[t,f("div",{className:"vreo-infoPanelImg",style:{backgroundImage:`url(${e})`}})]})}function xe({url:e,children:t}){return M("div",{className:"vreo-infoPanel vreo-infoPanel--video",children:[t,f("div",{className:"vreo-infoPanelWrapper",children:f("video",{playsInline:!0,autoPlay:!0,className:"vreo-infoPanelVideo",src:e})})]})}const W=e=>!e.title&&!e.subTitle?null:M("div",{className:"vreo-infoPanel-title",children:[f("div",{className:"vreo-infoPanel-t1",children:e.title}),f("div",{className:"vreo-infoPanel-t2",children:e.subTitle})]});function Ge(){const e=g.exports.useRef(),t=E();return g.exports.useEffect(()=>{var r;if(((r=t.configs)==null?void 0:r.keyframeMap.InfoPanel)===!1)return;const n=o=>{const{start:s,end:u,data:a}=o,p=a,{title:l,subTitle:d,style:i}=p;do{if(i===ne.PopUp){p.type===R.Image?t.openPopUp(f(ve,{url:p.url,children:f(W,{title:l,subTitle:d})})):p.type===R.Video&&t.openPopUp(f(xe,{url:p.url,children:f(W,{title:l,subTitle:d})}));break}p.type===R.Image?t.openDrawer({content:f(ve,{url:p.url,children:f(W,{title:l,subTitle:d})}),height:"60vh"}):p.type===R.Video&&t.openDrawer({content:f(xe,{url:p.url,children:f(W,{title:l,subTitle:d})}),height:"60vh"})}while(!1);e.current=setTimeout(()=>{t.openDrawer(!1),t.openPopUp(!1)},u-s)};return t.on(I.InfoPanel,n),()=>{t.off(I.InfoPanel,n),e.current&&clearTimeout(e.current)}},[t]),f(C,{})}const Je=(e,{videoElement:t})=>{const n={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},r=i=>{n.videoTexture&&(n.videoTexture.image.muted=i,n.videoTexture.image.play())},o=()=>n.videoTexture?n.videoTexture.image.muted:!0,s=()=>{if(n.enabled||!n.videoTexture)return;n.enabled=!0,n.videoMeshes=a(),n.videoMeshes.forEach(v=>e.scene.add(v));const i=()=>{if(!n.videoTexture)return;const v=()=>{var x;!n.videoTexture||((x=n.videoTexture)==null||x.image.removeEventListener("timeupdate",v),n.videoTextureEnabled=!0,n.videoMeshes.forEach(c=>{c.material.map!==n.videoTexture&&(c.material.map=n.videoTexture)}),e.needsRender=!0)};n.videoTexture.image.addEventListener("timeupdate",v),n.videoTexture&&n.videoMeshes.length&&n.videoTexture.image.play()};if(e.model.loaded)i();else return e.once("modelLoaded",()=>i())},u=()=>{!n.enabled||(n.enabled=!1,n.videoMeshes.forEach(i=>{i.geometry.dispose(),i.material.dispose(),e.scene.remove(i),n.videoTexture&&n.videoTexture.image.pause()}),n.videoMeshes=[],e.needsRender=!0)},a=()=>n.rectPoints.map((i,v)=>{const x=new Ee,c=128,m=[];m.push(i[0].x,i[0].y,i[0].z);for(let y=1;y<c;y++)m.push(i[0].x+(i[1].x-i[0].x)*y/c,i[0].y+(i[1].y-i[0].y)*y/c,i[0].z+(i[1].z-i[0].z)*y/c);m.push(i[1].x,i[1].y,i[1].z),m.push(i[2].x,i[2].y,i[2].z);for(let y=1;y<c;y++)m.push(i[2].x+(i[3].x-i[2].x)*y/c,i[2].y+(i[3].y-i[2].y)*y/c,i[2].z+(i[3].z-i[2].z)*y/c);m.push(i[3].x,i[3].y,i[3].z);const h=[];h.push(0,1);for(let y=1;y<c;y++)h.push(0,1-y/c);h.push(0,0),h.push(1,0);for(let y=1;y<c;y++)h.push(1,y/c);h.push(1,1);const b=[];for(let y=0;y<c;y++)b.push(y,y+1,c*2-y,y,c*2-y,c*2+1-y);x.setAttribute("position",new K(new Float32Array(m),3)),x.setAttribute("uv",new K(new Float32Array(h),2)),x.setIndex(new K(new Uint32Array(b),1));const A=new Ce({map:n.videoTextureEnabled?n.videoTexture:n.imageTexture,side:Me}),P=new ue(x,A);return P.renderOrder=1,P.name=`video-${v}-${performance.now()}`,P}),p=i=>{const v=new ce().load(i);return v.minFilter=$,v.magFilter=$,v.format=ae,v},l=(i,v)=>new Promise((x,c)=>{const m=new XMLHttpRequest;m.onreadystatechange=()=>{if(m.readyState==4)if(m.status==200){const h=window.URL||window.webkitURL;v=v||document.createElement("video"),v.crossOrigin="anonymous",v.autoplay=!0,v.muted=!0,v.loop=!0,v.playsInline=!0,v.src=h.createObjectURL(m.response);const b=new se(v);b.minFilter=$,b.magFilter=$,b.format=ae,x(Object.assign(b,{videoSource:i}))}else c(new Error("Video download Error: "+m.status))},m.onerror=h=>c(h),m.open("GET",i),m.responseType="blob",m.send()}),d=async(i,v)=>{const{video_src:x,video_poster_src:c,points:m}=i;n.videoSource=x,n.rectPoints=m.map(h=>h.map(({x:b,y:A,z:P})=>new T(b,A,P))),n.imageTexture=p(c),v&&(n.videoElement=v),n.videoTexture=await l(n.videoSource,n.videoElement),n.enabled=!!i.enable,n.enabled&&s()};return e.on("modeChange",()=>r(!0)),e.on("wantsTapGesture",i=>{if(!n.enabled)return;const[v]=i.intersectObjects(e.scene.children,!0);if(!!v&&/^video/.test(v.object.name))return n.videoTexture&&r(!n.videoTexture.image.muted),!1}),e.on("panoArrived",()=>{if(!n.enabled||o())return;const i=e.camera.position;n.rectPoints.find(x=>{const c=x.reduce((m,h)=>new T(m.x+h.x/x.length,m.y+h.y/x.length,m.z+h.z/x.length),new T);return x.map(m=>new T((m.x+c.x)/2,(m.y+c.y)/2,(m.z+c.z)/2)).filter(m=>{m=m.clone().sub(i).normalize();const h=new Ae(i,m),[b]=h.intersectObjects(e.scene.children,!0);return!!b&&/^video/.test(b.object.name)}).length>=2})||r(!0)}),e.on("renderFrame",()=>{n.videoMeshes.forEach(i=>{i&&(i.needsRender=!0)})}),e.on("load",i=>{i.modelTVVideoData&&d(i.modelTVVideoData)}),{enable:s,disable:u,load:d}};function He(e){const t=new ke;return t.fromArray(e),n=>{const r=new T(...n);return r.applyMatrix4(t),r.toArray()}}function Ke(){const e=E(),t=F(),n=g.exports.useRef(),r=g.exports.useRef();return g.exports.useEffect(()=>{const o=async s=>{var c,m;n.current||(n.current=Je(t,{}));const{start:u,end:a}=s,{videoSrc:p,videoPosterSrc:l,vertexs:d,matrixWorld:i}=s.data,v=(()=>{if(d.length<4)throw new Error("ModelVideo: \u9876\u70B9\u6570\u636E\u96C6\u5408\u4E0D\u591F\uFF0C\u65E0\u6CD5\u7EC4\u6210\u77E9\u5F62 ....");if(d.length===4)return d;const h=new Le;return d.forEach(b=>h.expandByPoint(new T(b.x,b.y,b.z))),[new T(h.min.x,h.max.y,h.max.z),new T(h.min.x,h.min.y,h.max.z),new T(h.max.x,h.min.y,h.max.z),new T(h.max.x,h.max.y,h.max.z)]})(),x=(()=>{if(i){const h=He(i);return[v.map(b=>{const A=h([b.x,b.y,b.z]);return{x:A[0],y:A[1],z:A[2]}})]}return[v]})();n.current.disable(),await n.current.load({video_src:p,video_poster_src:l,points:x},(m=(c=e.configs)==null?void 0:c.videos)==null?void 0:m.modelTVVideo),n.current.enable(),r.current=setTimeout(()=>{var h;return(h=n.current)==null?void 0:h.disable()},a-u)};return e.on(I.ModelVideo,o),()=>{e.off(I.ModelVideo,o),r.current&&clearTimeout(r.current)}},[e]),f(C,{})}class Qe extends Q.Tween{constructor(){super(...arguments);w(this,"disposeMethods",[]);w(this,"animationFrameDisposer");w(this,"onDispose",t=>(this.disposeMethods.push(t),this));w(this,"play",()=>(this.start(),this.animationFrameDisposer=O(()=>this.update()),this));w(this,"dispose",()=>{var t;this.stop(),(t=this.animationFrameDisposer)==null||t.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],Q.remove(this)})}}function Xe(e,t=Q.Easing.Linear.None){const n=new Qe({progress:0}).to({progress:1});return e!==void 0&&n.duration(e),t!==void 0&&n.easing(t),n}function Ye(e,t,n){const r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",o=new ce().load(r),s=new Se(16777215),u=new Fe;u.setMaterial({linewidth:2,color:s});const a=u.points.material;return a.map=o,a.color.set(s),u.line.material.depthTest=!1,Xe().onUpdate(({progress:p})=>{const l=.5-p/2,d=.5+p/2,i=t.clone().lerp(n,l),v=t.clone().lerp(n,d);u.setPoints(i,v)}).onStart(()=>e.scene.add(u)).onDispose(()=>{e.scene.remove(u),e.needsRender=!0})}function Ze(){const[e,t]=g.exports.useState(null),n=F(),r=g.exports.useRef(null),[o,s]=g.exports.useState(null),u=g.exports.useRef(),a=E(),p=Z(),l=()=>{r.current&&r.current.dispose()};return g.exports.useEffect(()=>{const d=i=>{const{start:v,end:x,data:c}=i,m=c,[h,b]=m.twoVertexs,A=new T(h.x,h.y,h.z),P=new T(b.x,b.y,b.z);r.current=Ye(n,A.clone(),P.clone()),r.current.play();const y=A.lerp(P,.5),G=A.distanceTo(P),B=p(y);if(!B)return;const{x:ge,y:ye}=B;t({center:y,distance:G}),s({left:ge,top:ye}),u.current=setTimeout(()=>{t(null),s(null),l()},x-v)};return a.on(I.PanoEffect,d),()=>{a.off(I.PanoEffect,d),u.current&&clearTimeout(u.current),l()}},[a]),g.exports.useEffect(()=>{const d=()=>{if(!(e==null?void 0:e.center))return;const{x:i,y:v,z:x}=e.center,c=p(new T(i,v,x));if(!c)return;const{x:m,y:h}=c;s({left:m,top:h})};return n.on("currentStateChange",d),()=>{n.off("currentStateChange",d)}},[e==null?void 0:e.center]),f(C,{children:f("div",{className:S("PanoEffect",{"PanoEffect--notHidden":e}),style:{left:((o==null?void 0:o.left)||0)+"px",top:((o==null?void 0:o.top)||0)+"px"},children:(e==null?void 0:e.distance.toFixed(4))+"m"})})}function et(){const[e,t]=g.exports.useState(null),[n,r]=g.exports.useState(null),o=g.exports.useRef(),s=E(),u=F(),a=Z();g.exports.useEffect(()=>{var d;if(((d=s.configs)==null?void 0:d.keyframeMap.PanoTag)===!1)return;const l=i=>{const{start:v,end:x,data:c}=i,m=c,h=m.vertex,{x:b,y:A,z:P}=m.vertex,y=a(new T(b,A,P));if(!y)return;const{x:G,y:B}=y;t({vertex:h,text:m.text||z.Text,type:m.type,imgUrl:m.imgUrl,style:m.style||_.Growth}),r({left:G,top:B}),o.current=setTimeout(()=>{t(null),r(null)},x-v)};return s.on(I.PanoTag,l),()=>{s.off(I.PanoTag,l),o.current&&clearTimeout(o.current)}},[s]),g.exports.useEffect(()=>{const l=()=>{if(!(e==null?void 0:e.vertex))return;const{x:d,y:i,z:v}=e.vertex,x=a(new T(d,i,v));if(!x)return;const{x:c,y:m}=x;r({left:c,top:m})};return u.on("currentStateChange",l),()=>{u.off("currentStateChange",l)}},[e==null?void 0:e.vertex]);const p=(()=>{if(!!e){if(e.type===z.Text)return f(C,{children:f("span",{children:e.text})});if(e.type===z.Image)return M(C,{children:[f("img",{className:"PanoTag-img",src:e.imgUrl,alt:e.text||""}),f("span",{className:"PanoTag-txt",children:e.text})]})}})();return(e==null?void 0:e.style)===_.Expand?f(C,{children:M("div",{className:S("PanoTag",{"PanoTag--expand":!0,"PanoTag--notHidden":e}),style:{left:((n==null?void 0:n.left)||0)+"px",top:((n==null?void 0:n.top)||0)+"px"},children:[f("div",{className:"PanoTag-box PanoTag-box--"+((e==null?void 0:e.type)||""),children:p}),f("div",{className:"PanoTag-guideline"})]})}):f(C,{children:M("div",{className:S("PanoTag",{"PanoTag--notHidden":e}),style:{left:((n==null?void 0:n.left)||0)+"px",top:((n==null?void 0:n.top)||0)+"px"},children:[f("div",{className:"PanoTag-point"}),M("div",{className:"PanoTag-content",children:[M("span",{className:"PanoTag-linewrap",children:[f("span",{className:"PanoTag-slashline"}),f("span",{className:"PanoTag-straightline"})]}),f("div",{className:"PanoTag-box PanoTag-box--"+((e==null?void 0:e.type)||""),children:p})]})]})})}function tt(){const[e,t]=g.exports.useState(null),n=g.exports.useRef(),r=E(),o=Z();return g.exports.useEffect(()=>{var u;if(((u=r.configs)==null?void 0:u.keyframeMap.PanoTextLabel)===!1)return;const s=a=>{const{start:p,end:l,data:d}=a,i=d,{x:v,y:x,z:c}=i.vertex,m=o(new T(v,x,c));if(!m)return;const{x:h,y:b}=m;t({left:h,top:b,text:d.text||"",fontSize:d.fontSize||16}),n.current=setTimeout(()=>t(null),l-p)};return r.on(I.PanoTextLabel,s),()=>{r.off(I.PanoTextLabel,s),n.current&&clearTimeout(n.current)}},[r]),f("div",{className:S("PanoTextLabel",{"PanoTextLabel--notHidden":e}),style:{left:((e==null?void 0:e.left)||0)+"px",top:((e==null?void 0:e.top)||0)+"px"},children:f("div",{className:"PanoTextLabel-wrapper",children:f("div",{style:{fontSize:`${(e==null?void 0:e.fontSize)||16}px`},className:"PanoText-innerText",children:(e==null?void 0:e.text)||""})})})}function nt(){const[e,t]=g.exports.useState(""),[n,r]=g.exports.useState(!0),o=g.exports.useRef(null),s=E();return g.exports.useEffect(()=>{var a;if(((a=s.configs)==null?void 0:a.keyframeMap.Prompter)===!1)return;const u=p=>{const{start:l,end:d,data:i}=p;t(i.text),r(!1),o.current&&(clearTimeout(o.current),o.current=null),o.current=setTimeout(()=>{r(!0),t(""),o.current&&clearTimeout(o.current),o.current=null},d-l)};return s.on(I.Prompter,u),()=>{s.off(I.Prompter,u)}},[s]),f("div",{className:S("vreo-prompter",{"vreo-prompter--hidden":n,"vreo-prompter--audio":s.isAudio}),children:f("div",{className:"vreo-prompter-text",children:f("div",{className:"vreo-prompter-innerText",children:e})})})}function ot(){const e=E(),t=F(),n=g.exports.useRef(null),r=g.exports.useRef(null),o=g.exports.useCallback(()=>{if(r.current=null,n.current){const a=V(n.current);t.load(a)}},[]),s=g.exports.useCallback(()=>{if(n.current){const a=V(n.current);Object.assign(window,{$rawWork:a}),t.load(a)}},[]),u=g.exports.useCallback(()=>{!r.current||t.load(r.current)},[]);return g.exports.useEffect(()=>{const a=p=>{var i;n.current||(n.current=t.work.raw.works);const l=p.data;if(l.work){r.current=V(l.work),t.load(r.current);return}const d=(i=t.work)==null?void 0:i.raw.works[0];if(l.dynamic_scene&&!l.panorama){const x=JSON.parse(d).panorama,c=l.dynamic_scene.images.index;x.list[c]=l.dynamic_scene.images,l.panorama=x,delete l.dynamic_scene}Object.assign(window,{$work1:JSON.parse(d),$work2:l,parseWork:V}),r.current=V([d,l]),t.load(r.current)};return e.on(I.UpdateVRPanorama,a),e.on(I.Exit,o),e.on("loaded",o),e.on("paused",s),e.on("playing",u),()=>{e.off(I.UpdateVRPanorama,a),e.off(I.Exit,o),e.off("loaded",o),e.off("paused",s),e.off("playing",u)}},[]),f(C,{})}const rt=e=>{if(!e)return;const t=()=>{e.removeEventListener("canplaythrough",t);try{e.play()}catch{}};e.addEventListener("canplaythrough",t),e.load()},it=Math.PI,oe=it*2;function st(){const e=g.exports.useRef(null),t=g.exports.useRef(),n=E(),r=g.exports.useRef(),[o,s]=g.exports.useState(!1),u=F(),a=p=>{!t.current||(t.current.src=p)};return g.exports.useEffect(()=>{const p=async l=>{const{start:d,end:i}=l,{videoSrc:v,fov:x,direction:c,panoIndex:m,vector:h}=l.data,[b,A]=(()=>{if(h)return[h.longitude,h.latitude];if(!c)return[0,0];let P=-Math.atan2(c.x,-c.z);P=(P%oe+oe)%oe;const y=-Math.asin(c.y/1);return[P,y]})();u.setState({fov:x,panoIndex:m,longitude:b,latitude:A},!0),a(v),rt(t.current),s(!0),r.current=setTimeout(()=>{var P,y;((P=t.current)==null?void 0:P.paused)||(y=t.current)==null||y.pause(),s(!1),a("")},i-d)};return n.on(I.VideoEffect,p),()=>{n.off(I.VideoEffect,p),r.current&&clearTimeout(r.current)}},[n]),g.exports.useEffect(()=>{var l,d;if(!e.current)return;const p=((d=(l=n.configs)==null?void 0:l.videos)==null?void 0:d.videoEffect)||document.createElement("video");p.setAttribute("playsinline","true"),p.setAttribute("webkit-playsinline","true"),p.setAttribute("autoplay","true"),p.setAttribute("key","VideoEffect-video"),p.setAttribute("class","VideoEffect-video"),t.current=p,e.current.append(t.current),document.addEventListener("WeixinJSBridgeReady",function(){var i;(i=t.current)==null||i.play()},!1),!!e.current},[]),f("div",{ref:e,className:S("VideoEffect",{"VideoEffect--visible":o})})}const at={blob:e=>{const t=()=>null;return new Promise((n,r)=>{const o=new XMLHttpRequest,s=()=>{o.ontimeout=t,o.onreadystatechange=t,o.onprogress=t,o.onabort=t};o.ontimeout=()=>{r(new Error("timeout")),s()},o.onreadystatechange=()=>{o.readyState===4&&(o.status===0&&!o.response||(o.status===200||o.status===0?(n(o.response),s()):(r(new Error("status:"+o.status)),s())))},o.open("GET",e,!0),o.responseType="blob",o.send(null)})}};class ut extends J{constructor({duration:t}={}){super();w(this,"$timestamp",0);w(this,"$currentTime",0);w(this,"$duration",0);w(this,"stopInterval");w(this,"muted",!1);w(this,"src","");t&&(this.$duration=t)}setAttribute(t,n){}play(){this.$timestamp===0&&(this.$timestamp=performance.now()),this.$currentTime===this.$duration&&(this.$currentTime=0),this.stopInterval=O(()=>this.requestAnimationFrameLoop()),this.emit("play")}pause(){this.stopInterval&&(this.stopInterval(),this.emit("pause"),this.stopInterval=void 0),this.$timestamp=0}requestAnimationFrameLoop(){const t=performance.now();this.$currentTime=t-this.$timestamp,this.emit("timeupdate"),this.$currentTime>=this.$duration-10&&(this.$currentTime=this.$duration,this.pause(),this.emit("ended"))}get currentTime(){return this.$currentTime/1e3}set currentTime(t){this.$currentTime=t}get duration(){return this.$duration}set duration(t){this.pause(),this.$duration=t,this.$timestamp=0,this.$currentTime=0}get ended(){return this.$currentTime===this.$duration}get paused(){return!this.stopInterval}addEventListener(t,n,r=!1){this.on(t,n)}removeEventListener(t,n,r=!1){this.off(t,n)}}const ct=`
2
- varying vec2 vUv;
3
- varying vec2 vColorUv;
4
- varying vec2 vMaskUv;
5
- void main(){
6
- vUv = uv;
7
- vColorUv = vec2(uv.x / 2.0, uv.y);
8
- vMaskUv = vec2(0.5 + uv.x / 2.0, uv.y);
9
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
10
- }
11
- `,lt=()=>`
12
- uniform int enable;
13
- uniform sampler2D map;
14
- varying vec2 vUv;
15
- varying vec2 vColorUv;
16
- varying vec2 vMaskUv;
17
-
18
- vec3 hsv2rgb(vec3 c) {
19
- const vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
20
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
21
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
22
- }
23
-
24
- vec3 rgb2hsv(vec3 c) {
25
- const vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
26
- vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
27
- vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
28
-
29
- float d = q.x - min(q.w, q.y);
30
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + 0.001)), d / (q.x + 0.001), q.x);
31
- }
32
-
33
- void main(void) {
34
- vec3 color = texture2D(map, vUv).xyz;
35
- float amask = 1.0;
36
-
37
- float ref = color.r;
38
- if (ref < color.b) ref = color.b;
39
- amask = color.g - ref + 0.1;
40
- amask = smoothstep(0.1, 0.3, amask);
41
- amask = 1.0 - amask;
42
-
43
- vec3 target = rgb2hsv(vec3(0.0 / 255.0, 255.0 / 255.0, 0.0 / 255.0));
44
- vec3 hsv = rgb2hsv(color);
45
- float distance = abs(hsv.x - target.x);
46
- if (distance < 0.15) {
47
- hsv.y = 0.0;
48
- }
49
- color = hsv2rgb(hsv);
50
-
51
- gl_FragColor = vec4(color.rgb, amask * float(enable));
52
- }
53
- `,k={};class dt extends ue{constructor(t,n,r,o,s={}){var v,x;if(!s.videoInstance)if(k.videoInstance)s.videoInstance=k.videoInstance;else{const c=document.createElement("video");c.style.opacity="0",c.style.display="none",document.body.append(c),s.videoInstance=c,k.videoInstance=c,c.playsInline=!0,c.controls=!1}const u=new Re(t,n,r,o),a=new se(s.videoInstance),p=new Ue({uniforms:{map:{value:a},enable:{value:0}},vertexShader:ct,fragmentShader:lt(),transparent:!0});super(u,p);w(this,"options");w(this,"videoUrl");w(this,"freeze");w(this,"paused");w(this,"audioInstance");w(this,"audioLikeInstance");w(this,"$removeEventListener");if(this.options=s,this.freeze=!1,this.paused=!0,s.audioInstance)this.audioInstance=s.audioInstance;else if(k.audioInstance)this.audioInstance=k.audioInstance;else{const c=document.createElement("audio");c.crossOrigin="",c.muted=!1,c.setAttribute("playsinline","true"),c.setAttribute("webkit-playsinline","true"),c.setAttribute("autoplay","false"),c.setAttribute("style","display: none;"),document.body.appendChild(c),this.audioInstance=c,k.audioInstance=c}this.audioLikeInstance=new ut,re(this,{paused:U});const l=c=>Ve(()=>this.paused=c),d=()=>l(!0),i=()=>l(!1);this.audioInstance.addEventListener("pause",d),this.audioInstance.addEventListener("play",i),(v=this.options.videoInstance)==null||v.addEventListener("pause",d),(x=this.options.videoInstance)==null||x.addEventListener("play",i),this.audioLikeInstance.addEventListener("pause",d),this.audioLikeInstance.addEventListener("play",i),this.$removeEventListener=()=>{var c,m;this.audioInstance.removeEventListener("pause",d),this.audioInstance.removeEventListener("play",i),(c=this.options.videoInstance)==null||c.removeEventListener("pause",d),(m=this.options.videoInstance)==null||m.removeEventListener("play",i),this.audioLikeInstance.removeEventListener("pause",d),this.audioLikeInstance.removeEventListener("play",i)}}get videoInstance(){var r;return this.videoUrl?((r=this.videoUrl)==null?void 0:r.endsWith("mp3"))?this.audioInstance:this.material.uniforms.map.value.image:this.audioLikeInstance}async update(t){if(this.videoUrl===t)return;this.videoUrl=t,this.freeze=!0,await this.videoInstance.pause();const n=this.material.uniforms;this.videoInstance.muted=!0,this.videoInstance.src=await URL.createObjectURL(await at.blob(this.videoUrl)),this.videoInstance.setAttribute("data-src",this.videoUrl);const r=()=>{var o;this.videoInstance.currentTime!==0&&(this.freeze=!1,this.videoInstance.muted=!1,n.enable.value=((o=this.videoUrl)==null?void 0:o.endsWith(".mp4"))?1:0,this.videoInstance.removeEventListener("timeupdate",r,!1))};this.videoInstance.addEventListener("timeupdate",r,!1)}async play(t="",n=0,r){return t=t||"",r&&!t?(this.currentTime&&(this.videoInstance.currentTime=n),this.videoInstance.duration=r,this.videoUrl="",this.videoInstance.play(),!0):t?(console.log("play",t,this.videoUrl),t===this.videoUrl?(this.videoInstance.currentTime=n,await this.videoInstance.play(),!0):(await this.update(t),this.videoInstance.pause(),await new Promise(o=>setTimeout(async()=>{this.videoInstance.currentTime=n,await this.videoInstance.play(),o(!0)},20)))):(this.videoUrl?await this.videoInstance.play():console.warn("\u8B66\u544A\uFF1A\u89C6\u9891\u8D44\u6E90\u672A\u521D\u59CB\u5316\u3002"),!0)}get currentTime(){return this.videoInstance.currentTime*1e3}dispose(){this.$removeEventListener(),k.audioInstance&&(document.body.removeChild(k.audioInstance),k.audioInstance=void 0),k.videoInstance&&(document.body.removeChild(k.videoInstance),k.videoInstance=void 0)}}class ft{constructor(t,n=!0,r={}){w(this,"videoAgentMesh");w(this,"scene",new ze);w(this,"camera",new Be(-240,240,135,-135));w(this,"renderer",new Ne({alpha:!0}));w(this,"container");w(this,"run",()=>{var n;const t=this.renderer.domElement;!(this.videoAgentMesh.paused||this.videoAgentMesh.freeze)&&this.videoAgentMesh.currentTime>1e3&&this.renderer.render(this.scene,this.camera),((n=this.videoAgentMesh.videoUrl)==null?void 0:n.endsWith(".mp4"))?t.style.display!=="block"&&(t.style.display="block"):t.style.display!=="none"&&(t.style.display="none"),requestAnimationFrame(this.run)});w(this,"dispose",()=>{var t;(t=this.videoAgentMesh)==null||t.dispose()});this.container=t,this.camera.position.set(0,0,10),this.camera.lookAt(0,0,0);const o={width:t.offsetWidth,height:t.offsetHeight},s=this.renderer.domElement;s.classList.add("VideoAgent-canvas"),this.renderer.setSize(o.width*window.devicePixelRatio,o.height*window.devicePixelRatio),s.setAttribute("style",`width: ${o.width}px;height: ${o.height}px;`),this.videoAgentMesh=new dt(480,270,1,1,r),n&&(t.append(s),this.scene.add(this.videoAgentMesh),this.run())}}function pt(e){const t=g.exports.useRef(null),n=E();return g.exports.useEffect(()=>{if(!t.current)throw new Error("React \u6E32\u67D3\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5 ...");if(n.videoAgentScene){console.warn('"VideoAgentScene" \u91CD\u590D\u521D\u59CB\u5316\uFF0C\u5DF2\u88AB\u8FC7\u6EE4 ...');return}const r=new ft(t.current,!0,e.options||{});return n.videoAgentScene=r,()=>{var o;n.dispose(),(o=n.videoAgentScene)==null||o.dispose()}},[]),f("div",{className:"VideoAgent",onClick:()=>{!e.onClick||e.onClick()},ref:t,children:f("div",{className:"VideoAgent-play"})})}function mt(){const e=E(),t=g.exports.useRef(null),n=g.exports.useCallback(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]);return g.exports.useEffect(()=>{const r=new Audio;r.setAttribute("id","vreo-singleton-bgmusic"),r.style.display="none",r.setAttribute("playsinline","true"),r.loop=!0,document.body.append(r);const o=s=>{const{start:u,end:a}=s,{url:p}=s.data;r.src=p;const l=()=>{r.play()};r.addEventListener("canplaythrough",l),n();const d=()=>{r.pause(),r.currentTime=0,r.src="",n(),r.removeEventListener("canplaythrough",l)},i=a-u||5e3;t.current=setTimeout(()=>{d()},i),e.once("paused",()=>{d()})};return e.on(I.BgMusic,o),()=>{e.off(I.BgMusic,o),document.body.removeChild(r),n()}}),f(C,{})}const ht=X(({controller:e})=>{var t,n;return f("div",{className:S("vreo-panel",{"vreo-panel--hidden":!e.visible}),children:M("div",{className:"vreo-panel-inner",children:[f(pt,{onClick:()=>{e.isAudio||(e.playing?e.setPlaying(!1):e.setPlaying(!0))},options:((t=e.configs)==null?void 0:t.videoAgentMeshOptions)||{}}),f(nt,{}),(n=e.configs)==null?void 0:n.customPanelChildren]})})});function vt(){const e=E();return M(C,{children:[M(C,{children:[f(We,{}),f(Ke,{}),f(ot,{}),f(st,{}),f(et,{}),f(tt,{}),f(Ge,{}),f(Ze,{}),f(mt,{})]}),f(ht,{controller:e})]})}const xt=X(({controller:e})=>{var r;const t="400px",n=(()=>{var s;const o=(s=e.drawerConfig)==null?void 0:s.height;return o?typeof o=="number"?o+"px":o:"max-content"})();return f("div",{className:S("vreo-drawer",{"vreo-drawer-visible":e.drawerConfig&&e.drawerConfig.content}),onClick:()=>e.openDrawer(!1),children:f("div",{className:"vreo-drawer-inner",style:{height:n,maxHeight:t},children:((r=e.drawerConfig)==null?void 0:r.content)||""})})});function gt(){const e=E();return f(xt,{controller:e})}const yt=X(({controller:e})=>f("div",{className:S("vreo-PopUp",{"vreo-PopUp-visible":e.popUp}),onClick:()=>e.openPopUp(!1),children:f("div",{className:"vreo-PopUp-inner",children:e.popUp||""})}));function wt(){const e=E();return f(yt,{controller:e})}class Pt extends J{constructor(t,n={}){super();w(this,"$five");w(this,"controller");w(this,"configs");if(this.controller=new Oe,this.$five=this.controller.$five=t,!n.containter){const r=document.querySelector("#vreo-app")||document.createElement("div");Y.exports.unmountComponentAtNode(r),r.setAttribute("id","vreo-app"),n.containter=r,document.body.append(r)}this.configs=Object.freeze(Object.assign({keyframeMap:{}},n)),this.controller.configs=this.configs,Y.exports.render(M(de.Provider,{value:this.controller,children:[f(vt,{}),f(gt,{}),f(wt,{}),this.configs.customKeyframes&&this.configs.customKeyframes.map((r,o)=>f(r,{subscribe:{on:(s,u)=>this.on(s,u),once:(s,u)=>this.once(s,u),off:(s,u)=>this.off(s,u)},five:t},o))]}),n.containter),ie(()=>this.controller.playing,r=>{this.emit(r?"playing":"paused")})}async load(t,n=0,r=!1,o=!1){var s,u,a,p;if(o&&(t=JSON.parse(JSON.stringify(t))),this.controller.visible||(this.controller.setVisible(!0),await new Promise(l=>{setTimeout(()=>l(!0),500)})),this.controller.stopInterval&&(this.controller.stopInterval(),this.controller.stopInterval=void 0),this.controller.vreoUnit=t,(s=this.controller.videoInstance)==null||s.pause(),this.$five.imageOptions.size&&((u=this.configs.imageOptions)==null?void 0:u.size)&&this.$five.imageOptions.size>this.configs.imageOptions.size&&(this.$five.imageOptions.size=this.configs.imageOptions.size),r||r===void 0&&this.configs.autoPreload){const l=t.keyframes.filter(i=>!(i.type!==I.CameraMovement||i.data.panoIndex===void 0)).reduce((i,v)=>{const x=v.data.panoIndex;return i[x]||(i[x]=!0),i},{}),d=Object.keys(l);for(let i=0;i<d.length;i++)await this.$five.preloadPano(Number(d[i]))}return this.emit("loaded",t),this.controller.emit("loaded",t),((a=this.controller.videoAgentScene)==null?void 0:a.videoAgentMesh.videoInstance)&&(this.controller.videoAgentScene.videoAgentMesh.videoInstance.currentTime=n/1e3),await((p=this.controller.videoAgentScene)==null?void 0:p.videoAgentMesh.play(t.video.url,n/1e3,t.video.duration)),this.play(),this.controller.run((l,d)=>this.emit(l,d)),!0}get paused(){return!this.controller.playing}play(t){return this.controller.playing||(t&&this.controller.videoInstance&&(this.controller.videoInstance.currentTime=t/1e3),Object.assign(window,{$vreoController:this.controller}),this.controller.setPlaying(!0)),!0}pause(){this.controller.setPlaying(!1)}show(){this.controller.setVisible(!0)}hide(){this.controller.setVisible(!1)}dispose(){this.pause(),this.controller.dispose(),this.configs.containter&&Y.exports.unmountComponentAtNode(this.configs.containter)}}console.log(`
54
-
55
- \u250F\u2501\u2501\u2501\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u250F\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
56
- \u2503\u250F\u2501\u2513\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2503\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
57
- \u2503\u2517\u2501\u251B\u2503\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u2501\u2503\u2503\u2501\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513
58
- \u2503\u250F\u2513\u250F\u251B\u2503\u250F\u2513\u2503\u2517\u2501\u2513\u2503\u2501\u2503\u2503\u2501\u2503\u2501\u2501\u252B\u2503\u250F\u2513\u2503\u2503\u250F\u2513\u2503
59
- \u2503\u2503\u2503\u2517\u2513\u2503\u2503\u2501\u252B\u2503\u2517\u251B\u2517\u2513\u2503\u2517\u2513\u2523\u2501\u2501\u2503\u2503\u2503\u2501\u252B\u2503\u2503\u2501\u252B
60
- \u2517\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u2501\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B
61
- \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
62
- \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
63
-
64
- `);export{Pt as P,I as V};
@@ -1 +0,0 @@
1
- import"./default.f03f1cdd.js";import{c,R as d,j as e,r as o,a as i,p as l,f as r}from"./vendor.d3e0753c.js";import{w as p}from"./znRoyv06SZQeqA7m.0057e8ae.js";import{R as u}from"./index.485f13f7.js";import{V as m,A as f}from"./AppReact.388465e9.js";const v={imageOptions:{size:1024},textureOptions:{size:64},onlyRenderIfNeeds:!0,antialias:!1,model:{},plugins:[]},j=c(v);function x(){const[t,n]=o.exports.useState(!1),a=t?i(j,{initialWork:l(p),ref:s=>Object.assign(window,{$five:s==null?void 0:s.five}),children:[e(u,{}),e(m,{children:e(f,{})})]}):e(r,{});return i(r,{children:[e("button",{style:{position:"absolute",zIndex:1e6,top:"36px",left:"36px"},onClick:()=>n(!t),children:t?"\u9500\u6BC1":"\u521B\u5EFA"}),a]})}d.render(e(o.exports.StrictMode,{children:e(x,{})}),document.getElementById("root"));