{"version":3,"file":"ScrollToTopButton-DPq6-bUQ-chunk.js","sources":["../../../GSDClient/Scripts/Hooks/useScrollPosition.tsx","../../../GSDClient/Scripts/Components/ScrollToTopButton.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst isBrowser = typeof window !== 'undefined';\nconst useScrollPosition = () => {\n const [scrollPosition, setScrollPosition] = useState(0);\n\n useEffect(() => {\n if (!isBrowser) {\n return;\n }\n\n const handleScroll = () => {\n setScrollPosition(window.scrollY);\n };\n\n window.addEventListener('scroll', handleScroll);\n handleScroll();\n\n return () => window.removeEventListener('scroll', handleScroll);\n }, [isBrowser]);\n\n return scrollPosition;\n};\n\nexport default useScrollPosition;\n","import useScrollPosition from 'Hooks/useScrollPosition';\nimport CaretDownWideThin from 'Icons/caretGsd.svg?react';\n\ninterface IScrollToTopButton {\n translations: {\n scrollToTop: string;\n };\n}\n\nconst ScrollToTopButton = ({ translations }: IScrollToTopButton) => {\n const isBrowser = typeof window !== 'undefined';\n const scrollPosition = useScrollPosition();\n const threshold = isBrowser ? window.innerHeight * 1.5 : null;\n const scrollToTop = () => window.scrollTo({ top: 0, behavior: 'smooth' });\n\n return (\n scrollToTop()}\n className={`fixed bottom-[5%] right-[calc(5%_+_var(--scrollbar-width))] z-10 flex h-9 w-9 origin-right items-center justify-center rounded-full bg-silverLight opacity-0 transition-[visibility,_opacity] duration-layout lg:h-14 lg:w-14 ${\n scrollPosition > threshold ? 'visible opacity-100' : 'invisible'\n }`}\n >\n {translations.scrollToTop}\n \n \n );\n};\n\nexport default ScrollToTopButton;\n"],"names":["isBrowser","useScrollPosition","scrollPosition","setScrollPosition","useState","useEffect","handleScroll","ScrollToTopButton","translations","threshold","scrollToTop","jsxs","jsx","CaretDownWideThin"],"mappings":"kGAEA,MAAMA,EAAY,OAAO,OAAW,IAC9BC,EAAoB,IAAM,CAC5B,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,WAAS,CAAC,EAEtDC,OAAAA,EAAAA,UAAU,IAAM,CACZ,GAAI,CAACL,EACD,OAGJ,MAAMM,EAAe,IAAM,CACvBH,EAAkB,OAAO,OAAO,CAAA,EAG7B,cAAA,iBAAiB,SAAUG,CAAY,EACjCA,IAEN,IAAM,OAAO,oBAAoB,SAAUA,CAAY,CAAA,EAC/D,CAACN,CAAS,CAAC,EAEPE,CACX,ECbMK,EAAoB,CAAC,CAAE,aAAAC,KAAuC,CAC1D,MAAAR,EAAY,OAAO,OAAW,IAC9BE,EAAiBD,IACjBQ,EAAYT,EAAY,OAAO,YAAc,IAAM,KACnDU,EAAc,IAAM,OAAO,SAAS,CAAE,IAAK,EAAG,SAAU,QAAA,CAAU,EAGpE,OAAAC,EAAA,KAAC,SAAA,CACG,KAAK,SACL,QAAS,IAAMD,EAAY,EAC3B,UAAW,iOACPR,EAAiBO,EAAY,sBAAwB,WACzD,GAEA,SAAA,CAAAG,EAAA,IAAC,OAAK,CAAA,UAAU,UAAW,SAAAJ,EAAa,YAAY,EACpDI,EAAAA,IAACC,EAAkB,CAAA,UAAU,sCAAuC,CAAA,CAAA,CAAA,CAAA,CAGhF"}