{"version":3,"file":"ScrollToTop.DoYEKipj.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/1geAlNtJ5YylXS2z6E14/EGQQzmVHfzgGabuPJz8S/ScrollToTop.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export function ScrollToTop({background=\"#000\",color=\"#fff\",size=48,showAfter=300,iconSize=20,anchorLeft=true,leftOffset=30,rightOffset=30,bottomOffset=30}){const[visible,setVisible]=React.useState(false);React.useEffect(()=>{const toggleVisibility=()=>setVisible(window.scrollY>showAfter);toggleVisibility();window.addEventListener(\"scroll\",toggleVisibility);return()=>window.removeEventListener(\"scroll\",toggleVisibility);},[showAfter]);const scrollToTop=()=>window.scrollTo({top:0,behavior:\"smooth\"});// Compose safe-area aware offset (for iOS notch / home indicator)\nconst safeBottom=`calc(${bottomOffset}px + env(safe-area-inset-bottom, 0px))`;const safeLeft=`calc(${leftOffset}px + env(safe-area-inset-left, 0px))`;const safeRight=`calc(${rightOffset}px + env(safe-area-inset-right, 0px))`;return /*#__PURE__*/_jsx(motion.button,{type:\"button\",\"aria-label\":\"Scroll to top\",onClick:scrollToTop,initial:{opacity:0,y:30},animate:{opacity:visible?1:0,y:visible?0:30},transition:{duration:.25},style:{position:\"fixed\",bottom:safeBottom,left:anchorLeft?safeLeft:undefined,right:anchorLeft?undefined:safeRight,background,color,border:\"none\",borderRadius:\"50%\",width:size,height:size,cursor:\"pointer\",boxShadow:\"0 4px 10px rgba(0,0,0,0.15)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:9999},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 24 24\",width:iconSize,height:iconSize,fill:color,\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 4l-8 8h6v8h4v-8h6z\"})})});}addPropertyControls(ScrollToTop,{background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000\"},color:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#fff\"},size:{type:ControlType.Number,title:\"Button Size\",defaultValue:48,min:24,max:120},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:20,min:10,max:72},showAfter:{type:ControlType.Number,title:\"Show After (px)\",defaultValue:300,min:0,max:5e3},anchorLeft:{type:ControlType.Boolean,title:\"Anchor Left\",defaultValue:true},leftOffset:{type:ControlType.Number,title:\"Left Offset\",defaultValue:30,min:0,max:300},rightOffset:{type:ControlType.Number,title:\"Right Offset\",defaultValue:30,min:0,max:300},bottomOffset:{type:ControlType.Number,title:\"Bottom Offset\",defaultValue:30,min:0,max:300}});// (Optional) Keep default export for Framer detection if needed\nexport default ScrollToTop;\nexport const __FramerMetadata__ = {\"exports\":{\"ScrollToTop\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTop.map"],"mappings":"gPAA6J,SAAgB,EAAY,CAAC,aAAW,OAAO,QAAM,OAAO,OAAK,GAAG,YAAU,IAAI,WAAS,GAAG,aAAW,GAAK,aAAW,GAAG,cAAY,GAAG,eAAa,IAAI,CAAC,GAAK,CAAC,EAAQ,GAAYA,EAAe,GAAM,CAAC,MAAoB,CAAC,IAAM,MAAqB,EAAW,EAAO,QAAQ,EAAU,CAAuE,OAAtE,GAAkB,CAAC,EAAO,iBAAiB,SAAS,EAAiB,KAAW,EAAO,oBAAoB,SAAS,EAAiB,EAAG,CAAC,EAAU,CAAC,CAAC,IAAM,MAAgB,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,SAAS,CAAC,CAC9oB,EAAW,QAAQ,EAAa,wCAA8C,EAAS,Q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