{"version":3,"file":"BackToTop.CFc8b5D5.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/CmrSGpHw4RgNjkjutBSC/83qeD4CPzh1j4cPtQhd0/BackToTop.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 82\n * @framerIntrinsicHeight 48\n */export default function BackToTop(props){const{backgroundColor,textColor,showAfter,headerHeight}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[visible,setVisible]=React.useState(isCanvas);const[mounted,setMounted]=React.useState(false);React.useEffect(()=>{setMounted(true);const checkScroll=()=>{const scrollAmount=window.scrollY||document.documentElement.scrollTop||0;setVisible(scrollAmount>=showAfter);};if(!isCanvas){checkScroll();window.addEventListener(\"scroll\",checkScroll,{passive:true});}return()=>{window.removeEventListener(\"scroll\",checkScroll);};},[isCanvas,showAfter]);const scrollToTop=()=>{window.scrollTo({top:0,behavior:\"smooth\"});};const button=/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:scrollToTop,\"aria-label\":\"Back to top\",style:{position:isCanvas?\"relative\":\"fixed\",top:isCanvas?0:headerHeight,right:isCanvas?\"auto\":0,zIndex:9e3,width:82,height:48,padding:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:7,border:\"none\",borderRadius:\"0 0 0 8px\",backgroundColor,color:textColor,fontFamily:\"inherit\",fontSize:13,fontWeight:700,letterSpacing:\"0.06em\",cursor:\"pointer\",boxShadow:\"0 8px 22px rgba(0,35,80,0.22)\",opacity:visible?1:0,visibility:visible?\"visible\":\"hidden\",pointerEvents:visible?\"auto\":\"none\",transform:visible?\"translateX(0)\":\"translateX(110%)\",transition:\"transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.25s ease\"},children:[\"TOP\",/*#__PURE__*/_jsx(\"svg\",{width:\"15\",height:\"15\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 15L12 9L18 15\",stroke:\"currentColor\",strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]});if(isCanvas)return button;if(!mounted)return null;return /*#__PURE__*/createPortal(button,document.body);}BackToTop.defaultProps={width:82,height:48,backgroundColor:\"#0A284D\",textColor:\"#FFFFFF\",showAfter:400,headerHeight:76};addPropertyControls(BackToTop,{backgroundColor:{type:ControlType.Color,title:\"Background\"},textColor:{type:ControlType.Color,title:\"Text\"},showAfter:{type:ControlType.Number,title:\"Show After\",min:100,max:1500,step:50,unit:\"px\"},headerHeight:{type:ControlType.Number,title:\"Header Height\",min:0,max:200,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTop\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"48\",\"framerIntrinsicWidth\":\"82\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToTop.map"],"mappings":"iNAKG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,kBAAgB,YAAU,YAAU,gBAAc,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAY,CAAC,EAAQ,GAAYA,EAAe,CAAQ,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAE,MAAoB,CAAC,EAAW,EAAI,EAAE,IAAM,MAAgB,CAAC,IAAM,EAAa,EAAO,SAAS,SAAS,gBAAgB,WAAW,EAAE,EAAW,GAAc,CAAS,CAAE,EAA4F,OAAtF,IAAU,EAAY,EAAE,EAAO,iBAAiB,SAAS,EAAY,CAAC,QAAQ,EAAI,CAAC,OAAa,CAAC,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