"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("./useWindowSize.js"),r=require("../common/helpers.js");const s=({containerBoundingClientRect:s,backgroundBoundingClientRect:u,speed:i=1})=>{let[a,l]=e.useState(0),[o,c]=e.useState(0),{height:f}=t.default();return e.useEffect(()=>{u&&s&&l(u.height-s.height)},[s,u]),e.useEffect(()=>{if(!s||!u||!f)return;let e=r.getPercentageVisible(u,f),t=e/100*a-a/2;c(-(t*i*1))},[a,f,s,u,i]),{translateValue:o}};exports.default=s,exports.useTranslateValue=s;
