{"version":3,"file":"BackToTopOnScroll.Dutk4D4G.mjs","names":["React.forwardRef","useState","useCallback","__esmMin","ne","init_npm_react_18_3_1","te","window","_e","J","init_jsx_runtime","ce","init_ssg_sandbox_shims","motion","addPropertyControls","init_framer_B1b760uK","ControlType","cx","useIsStaticRenderer","withCSS","useSVGTemplate","mask","Base","MotionSVG","SVG","svg","getProps","Icon","init_y52ysWUoo","props","rest","animated","color","width1","alpha","restProps","href","className","qxTvv_EBh","ezTt3ayMo","lschgej4H","style","BackToTopOnScroll","isStatic","isVisible","setIsVisible","updateVisibilityFromScroll","current","y","onScroll","scrollToTop","handleTap","event","handleClick","Component","init_BackToTopOnScroll"],"sources":["https:/framerusercontent.com/modules/ZZpxbrwF6wSX62EilgrF/iimdrXKk4ghY6N5tnggY/y52ysWUoo.js","https:/framerusercontent.com/modules/oZllMuZ39DVKFcJPiCTc/uSeAZvlS01dC9JbPEl1m/BackToTopOnScroll.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 6.75 L 6.75 0 L 13.5 6.75 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"6.75px\" id=\"yhZZECx0u\" transform=\"translate(5.25 6.75)\" width=\"13.5px\"/><path d=\"M 0 7.5 L 0 0\" fill=\"transparent\" height=\"7.5px\" id=\"GgtoHQFfG\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(12 13.5)\" width=\"1px\"/><path d=\"M 0 6.75 L 6.75 0 L 13.5 6.75 Z\" fill=\"transparent\" height=\"6.75px\" id=\"oRmLdmfGO\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(5.25 6.75)\" width=\"13.5px\"/><path d=\"M 0 0 L 16.5 0\" fill=\"transparent\" height=\"1px\" id=\"gtHArt6WK\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(3.75 3.75)\" width=\"16.5px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"1009892809\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-Cx0P0\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-Cx0P0 { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Line Up\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-Cx0P0\");Icon.displayName=\"Arrow Line Up\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Line Up\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";export function BackToTopOnScroll(Component){return /*#__PURE__*/forwardRef(function BackToTopOnScrollOverride(props,ref){const isStatic=useIsStaticRenderer();const[isVisible,setIsVisible]=useState(false);const updateVisibilityFromScroll=useCallback(y=>{startTransition(()=>{setIsVisible(current=>{if(!current&&y>280)return true;if(current&&y<80)return false;return current;});});},[]);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;updateVisibilityFromScroll(window.scrollY||0);const onScroll=()=>{updateVisibilityFromScroll(window.scrollY||0);};window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",onScroll);},[isStatic,updateVisibilityFromScroll]);const scrollToTop=useCallback(()=>{if(typeof window===\"undefined\")return;window.scrollTo({top:0,behavior:\"smooth\"});},[]);const handleTap=useCallback(event=>{scrollToTop();if(props.onTap)props.onTap(event);},[props,scrollToTop]);const handleClick=useCallback(event=>{scrollToTop();if(props.onClick)props.onClick(event);},[props,scrollToTop]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:handleTap,onClick:handleClick,animate:{...props.animate||{},x:\"-50%\",y:isVisible?0:-36,opacity:isVisible?1:0},transition:{duration:.22,ease:\"easeOut\",...props.transition||{}},style:{...props.style,position:\"fixed\",left:\"50vw\",right:\"auto\",top:props.style?.top??\"90px\",zIndex:9999,pointerEvents:isVisible?\"auto\":\"none\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"BackToTopOnScroll\":{\"type\":\"reactHoc\",\"name\":\"BackToTopOnScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}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