(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[6141],{776141(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>e.A});var e=__webpack_require__(939195)}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},939195(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>s});var e=__webpack_require__(787332);var t=__webpack_require__.n(e);var n=__webpack_require__(860012);var r=__webpack_require__(844113);var o=__webpack_require__.n(r);var l=__webpack_require__(456895);__webpack_require__.n(l);var i=__webpack_require__(158332);function u({animationEventEmitter:e,width:t="200",height:r="200",followMouse:u=!0,lookAtTarget:s={},lookAtDirection:c=null}){let d=(0,n.useRef)(null);let f=(0,n.useRef)(null);let a=(0,n.useRef)(null);let h=(0,n.useRef)(e);h.current=e;let w=(0,n.useRef)(u);!a.current&&(a.current=o()({followMouse:u,pxNotRatio:!0,width:t,height:r,meshJson:(0,i.zk)(),verticalFieldOfView:Math.PI/37.5,near:100,far:340}));let b=a.current;return(0,n.useEffect)(()=>{let e=d.current;if(!e)return undefined;e.appendChild(b.container),f.current=(({top:e,left:t,height:n,width:r})=>{let o=t+r/2;let l=e+n/2;return{up:{x:o,y:e-n},down:{x:o,y:e+n*2},left:{x:t-r,y:l},right:{x:t+r*2,y:l},middle:{x:o,y:l}}})(e.getBoundingClientRect());let t=(0,l.debounce)(b.setFollowMouse.bind(b,!0),1e3);let n=b.setFollowMouse.bind(b,!1);let r=h.current;let o=b.setFollowMouse.bind(b);return r.on("point",e=>{n(),b.lookAtAndRender(e),t()}),r.on("setFollowMouse",o),()=>{r.removeAllListeners(),b.container.remove(),b.stopAnimation()}},[b]),(0,n.useEffect)(()=>{let e=f.current;if(!e)return;c?b.lookAtAndRender(e[c]):s?.x&&s?.y&&b.lookAtAndRender(s)},[c,s,b]),(0,n.useEffect)(()=>{if(w.current===u)return;w.current=u;let e=(0,l.debounce)(b.setFollowMouse.bind(b,!0),1e3);b.setFollowMouse(!1),u&&e()},[u,b]),n.createElement("div",{ref:d,style:{zIndex:0}})}u.propTypes={animationEventEmitter:t().object.isRequired,width:t().string,height:t().string,followMouse:t().bool,lookAtTarget:t().object,lookAtDirection:t().oneOf(["up","down","left","right","middle"])};let s=u}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);