{"version":3,"file":"ScrollToTop.3bQdDmlr.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/IqucPfubCy5dzmK8xnzc/pF9adb7rN9H98p0GO9Vc/ScrollToTop.js"],"sourcesContent":["// Return to top of page component that is editable and responsive\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollToTop(props){const{showAfterScroll=300,position=\"bottom-right\",offsetX=24,offsetY=24,backgroundColor=\"#000000\",iconColor=\"#FFFFFF\",size=56,borderRadius=28,shadow=true,label=\"Back to top\",showLabel=false,font,arrowStyle=\"simple\"}=props;const[isVisible,setIsVisible]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const handleScroll=()=>{const scrolled=window.scrollY>showAfterScroll;startTransition(()=>setIsVisible(scrolled));};window.addEventListener(\"scroll\",handleScroll);handleScroll();return()=>window.removeEventListener(\"scroll\",handleScroll);},[showAfterScroll]);const scrollToTop=()=>{if(typeof window===\"undefined\")return;window.scrollTo({top:0,behavior:\"smooth\"});};const getPositionStyles=()=>{const base={position:\"fixed\",zIndex:9999};switch(position){case\"bottom-right\":return{...base,bottom:offsetY,right:offsetX};case\"bottom-left\":return{...base,bottom:offsetY,left:offsetX};case\"bottom-center\":return{...base,bottom:offsetY,left:\"50%\",transform:\"translateX(-50%)\"};case\"top-right\":return{...base,top:offsetY,right:offsetX};case\"top-left\":return{...base,top:offsetY,left:offsetX};case\"top-center\":return{...base,top:offsetY,left:\"50%\",transform:\"translateX(-50%)\"};default:return{...base,bottom:offsetY,right:offsetX};}};const renderArrowIcon=()=>{const iconSize=size*.4;const commonProps={width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0,margin:showLabel?0:\"auto\"}};switch(arrowStyle){case\"bold\":return /*#__PURE__*/_jsxs(\"svg\",{...commonProps,strokeWidth:\"3\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Arrow up\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 19V5M5 12l7-7 7 7\"})]});case\"chevron\":return /*#__PURE__*/_jsxs(\"svg\",{...commonProps,strokeWidth:\"2.5\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Chevron up\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M18 15l-6-6-6 6\"})]});case\"circle-arrow\":return /*#__PURE__*/_jsxs(\"svg\",{...commonProps,strokeWidth:\"2\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Circle arrow up\"}),/*#__PURE__*/_jsx(\"circle\",{cx:\"12\",cy:\"12\",r:\"10\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 16V8M8 12l4-4 4 4\"})]});case\"simple\":default:return /*#__PURE__*/_jsxs(\"svg\",{...commonProps,strokeWidth:\"2.5\",children:[/*#__PURE__*/_jsx(\"title\",{children:\"Arrow up\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 19V5M5 12l7-7 7 7\"})]});}};return /*#__PURE__*/_jsx(AnimatePresence,{children:isVisible&&/*#__PURE__*/_jsxs(motion.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},onClick:scrollToTop,style:{...getPositionStyles(),display:\"flex\",alignItems:\"center\",gap:showLabel?8:0,padding:showLabel?\"12px 20px\":0,width:showLabel?\"auto\":size,height:size,backgroundColor,border:\"none\",borderRadius:showLabel?borderRadius/2:borderRadius,cursor:\"pointer\",boxShadow:shadow?\"0 4px 12px rgba(0, 0, 0, 0.15)\":\"none\",outline:\"none\"},whileHover:{scale:1.05},whileTap:{scale:.95},\"aria-label\":label,children:[renderArrowIcon(),showLabel&&/*#__PURE__*/_jsx(\"span\",{style:{color:iconColor,whiteSpace:\"nowrap\",...font},children:label})]})});}addPropertyControls(ScrollToTop,{showAfterScroll:{type:ControlType.Number,title:\"Show After\",defaultValue:300,min:0,max:2e3,step:50,unit:\"px\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"bottom-right\",\"bottom-left\",\"bottom-center\",\"top-right\",\"top-left\",\"top-center\"],optionTitles:[\"Bottom Right\",\"Bottom Left\",\"Bottom Center\",\"Top Right\",\"Top Left\",\"Top Center\"],defaultValue:\"bottom-right\",displaySegmentedControl:true},offsetX:{type:ControlType.Number,title:\"Offset X\",defaultValue:24,min:0,max:200,step:4,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:24,min:0,max:200,step:4,unit:\"px\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:56,min:32,max:80,step:4,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:28,min:0,max:40,step:2,unit:\"px\"},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Back to top\",hidden:({showLabel})=>!showLabel},font:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{variant:\"Semibold\",fontSize:\"14px\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},hidden:({showLabel})=>!showLabel},arrowStyle:{type:ControlType.Enum,title:\"Arrow Style\",options:[\"simple\",\"bold\",\"chevron\",\"circle-arrow\"],optionTitles:[\"Simple\",\"Bold\",\"Chevron\",\"Circle Arrow\"],defaultValue:\"simple\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTop\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTop.map"],"mappings":"qQAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,kBAAgB,IAAI,WAAS,eAAe,UAAQ,GAAG,UAAQ,GAAG,kBAAgB,UAAU,YAAU,UAAU,OAAK,GAAG,eAAa,GAAG,SAAO,GAAK,QAAM,cAAc,YAAU,GAAM,OAAK,aAAW,UAAU,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAS,EAAO,QAAQ,EAAgB,MAAoB,EAAa,EAAS,CAAC,EAAiE,OAA9D,EAAO,iBAAiB,SAAS,EAAa,CAAC,GAAc,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,CAAC,EAAgB,CAAC,CAAC,IAAM,MAAgB,CAAW,IAAS,QAAmB,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,SAAS,CAAC,EAAS,MAAsB,CAAC,IAAM,EAAK,CAAC,SAAS,QAAQ,OAAO,KAAK,CAAC,OAAO,EAAP,CAAiB,IAAI,eAAe,MAAM,CAAC,GAAG,EAAK,OAAO,EAAQ,MAAM,EAAQ,CAAC,IAAI,cAAc,MAAM,CAAC,GAAG,EAAK,OAAO,EAAQ,KAAK,EAAQ,CAAC,IAAI,gBAAgB,MAAM,CAAC,GAAG,EAAK,OAAO,EAAQ,KAAK,MAAM,UAAU,mBAAmB,CAAC,IAAI,YAAY,MAAM,CAAC,GAAG,EAAK,IAAI,EAAQ,MAAM,EAAQ,CAAC,IAAI,WAAW,MAAM,CAAC,GAAG,EAAK,IAAI,EAAQ,KAAK,EAAQ,CAAC,IAAI,aAAa,MAAM,CAAC,GAAG,EAAK,IAAI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