{"version":3,"file":"ScrollToTopButton.DNETWb7Z.mjs","names":[],"sources":["https:/framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/9bbvaZD8RsNyj0rYVQ4z/Shared.js","https:/framer.com/m/Shared-8iGD.js@9bbvaZD8RsNyj0rYVQ4z","https:/framerusercontent.com/modules/b8wzgfWRyM6twUWE1O06/EUrgkH3KceWdFtNWGQme/ScrollToTopButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{motion}from\"framer-motion\";export const borderPropertyControl=(hidden=null)=>({type:ControlType.Object,optional:true,hidden,controls:{color:{type:ControlType.Color,defaultValue:\"#222\"},width:{type:ControlType.FusedNumber,defaultValue:1,toggleKey:\"widthIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"widthTop\",\"widthRight\",\"widthBottom\",\"widthLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},style:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}});export function Border({width,widthIsMixed,widthTop,widthRight,widthBottom,widthLeft,style,color,transition}){return /*#__PURE__*/_jsx(motion.div,{animate:{borderColor:color},style:{position:\"absolute\",inset:0,borderWidth:widthIsMixed?`${widthTop}px ${widthRight}px ${widthBottom}px ${widthLeft}px`:`${width}px`,borderStyle:style,borderRadius:\"inherit\",pointerEvents:\"none\"},initial:false,transition:transition});}export function EmptyState({title,subtitle,maxWidth=0}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",gap:16,backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:16,padding:20,minHeight:200,maxWidth:maxWidth||undefined},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,// maxWidth: 500,\nlineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}EmptyState.displayName=\"Empty State\";\nexport const __FramerMetadata__ = {\"exports\":{\"EmptyState\":{\"type\":\"reactComponent\",\"name\":\"EmptyState\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"Border\":{\"type\":\"reactComponent\",\"name\":\"Border\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"borderPropertyControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared.map","/*\n * Shared\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/9bbvaZD8RsNyj0rYVQ4z/Shared.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useAnimation}from\"framer-motion\";import{useEffect}from\"react\";import{cloneElement}from\"react\";import{borderPropertyControl,Border}from\"https://framer.com/m/Shared-8iGD.js@9bbvaZD8RsNyj0rYVQ4z\";function scrollToTop(){if(typeof window!==\"undefined\"){window.scrollTo({top:0,behavior:\"smooth\"});}}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n */export default function ScrollToTopButton(props){const controls=useAnimation();useEffect(()=>{const handleScroll=()=>{const scrollPosition=window.scrollY+window.innerHeight;const footerHeight=props.footerHeight;const documentHeight=document.documentElement.scrollHeight;if(window.scrollY>props.appearAfter&&scrollPosition<documentHeight-footerHeight){controls.start({opacity:1,transition:{duration:props.transitionDuration}});}else{controls.start({opacity:0,transition:{duration:props.transitionDuration}});}};controls.start({opacity:0})// Initially hide the button\n;window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[controls,props.appearAfter,props.transitionDuration,props.footerHeight]);if(props.buttonType==\"custom\"){var _props_custom,_props_style,_props_style1;let layer=(_props_custom=props.custom)===null||_props_custom===void 0?void 0:_props_custom[0];if(layer&&(((_props_style=props.style)===null||_props_style===void 0?void 0:_props_style.width)||((_props_style1=props.style)===null||_props_style1===void 0?void 0:_props_style1.height))){layer=/*#__PURE__*/cloneElement(layer,{style:{...layer.props.style,...props.style}});}return /*#__PURE__*/_jsx(motion.div,{animate:controls,onClick:scrollToTop,style:props.style,children:layer});}return /*#__PURE__*/_jsxs(motion.div,{animate:controls,style:{width:props.buttonWidth,height:props.buttonHeight,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:props.fill,cursor:\"pointer\",boxShadow:props.shadows,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,...props.style},onClick:scrollToTop,children:[/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"none\",viewBox:\"0 0 24 24\",strokeWidth:props.icon.stroke,stroke:props.icon.color,\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",style:{width:props.icon.size,height:props.icon.size},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 5l0 14\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M18 11l-6 -6\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M6 11l6 -6\"})]}),/*#__PURE__*/_jsx(Border,{...props.border})]});}ScrollToTopButton.displayName=\"Scroll-to-Top Button\";addPropertyControls(ScrollToTopButton,{buttonType:{type:ControlType.Enum,defaultValue:\"default\",options:[\"default\",\"custom\"],optionTitles:[\"Default\",\"Custom\"],displaySegmentedControl:true,title:\"Button\"},custom:{type:ControlType.ComponentInstance,title:\"Custom\",description:\"Connect a custom button layer.\",hidden(props){return props.buttonType!==\"custom\";}},fill:{type:ControlType.Color,defaultValue:\"#EDEDED\",optional:true,hidden(props){return props.buttonType!==\"default\";}},icon:{type:ControlType.Object,controls:{color:{type:ControlType.Color,defaultValue:\"black\"},size:{type:ControlType.Number,defaultValue:24,min:1},stroke:{type:ControlType.Number,defaultValue:2,min:1,max:10,step:.1}},hidden(props){return props.buttonType!==\"default\";}},radius:{type:ControlType.FusedNumber,defaultValue:20,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0,hidden(props){return props.buttonType!==\"default\";}},border:borderPropertyControl(props=>props.buttonType!==\"default\"),shadows:{type:ControlType.BoxShadow,hidden:props=>props.buttonType!=\"default\"},appearAfter:{type:ControlType.Number,title:\"Appear After (px)\",defaultValue:500,min:0},transitionDuration:{type:ControlType.Number,title:\"Transition Duration\",defaultValue:.5,min:0,max:5,step:.1,displayStepper:true},footerHeight:{type:ControlType.Number,title:\"Hide in Footer (px)\",defaultValue:800,min:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTopButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopButton.map"],"mappings":"+PAA+nB,SAAgB,EAAO,CAAC,QAAM,eAAa,WAAS,aAAW,cAAY,YAAU,QAAM,QAAM,cAAY,CAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAA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