{"version":3,"file":"MobileCallButtonVisibility.CSQwtriB.mjs","names":["React.forwardRef","useState","useRef","useCallback","__esmMin","init_ssg_sandbox_shims","te","init_npm_react_18_3_1","_e","ne","J","init_jsx_runtime","ce","de","window","useReducedMotion","init_framer_motion_DhsWWWsN","motion","addPropertyControls","cx","useSVGTemplate","init_framer_Bf4_tcb2","withCSS","ControlType","mask","Base","MotionSVG","SVG","svg","getProps","Icon","init_FFBSocAXx","props","rest","animated","width1","color","restProps","href","className","P_DcoRcrY","JEeZYcamG","style","MobileCallButtonVisibility","prefersReducedMotion","isMobileViewport","setIsMobileViewport","isVisible","setIsVisible","idleTimerRef","heroBottomRef","clearIdleTimer","hideButton","showButton","getHeroElement","selector","found","updateHeroBoundary","heroElement","rect","isWithinHero","scheduleRevealAfterIdle","updateViewportState","mobile","onScroll","Component","init_MobileCallButtonVisibility"],"sources":["https:/framerusercontent.com/modules/z0VfcXQJfhBPym0y6VJm/RNuv5R44eIT0gQ0O25Ow/FFBSocAXx.js","https:/framerusercontent.com/modules/qa8YBm7J3F9VGi92p03S/j4Rs3VrXoQdFNcAtw0mB/MobileCallButtonVisibility.js"],"sourcesContent":["// Generated by Framer (85eaff3)\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 0 C 4.971 0 9 4.029 9 9\" fill=\"transparent\" height=\"9px\" id=\"dneS7T_Hg\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(13 2)\" width=\"9px\"/><path d=\"M 0 0 C 2.761 0 5 2.239 5 5\" fill=\"transparent\" height=\"5px\" id=\"F13BNtf41\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(13 6)\" width=\"5px\"/><path d=\"M 11.832 14.568 C 12.257 14.763 12.761 14.637 13.045 14.265 L 13.4 13.8 C 13.778 13.296 14.37 13 15 13 L 18 13 C 19.105 13 20 13.895 20 15 L 20 18 C 20 19.105 19.105 20 18 20 C 8.059 20 0 11.941 0 2 C 0 0.895 0.895 0 2 0 L 5 0 C 6.105 0 7 0.895 7 2 L 7 5 C 7 5.63 6.704 6.222 6.2 6.6 L 5.732 6.951 C 5.353 7.24 5.231 7.756 5.44 8.184 C 6.807 10.96 9.054 13.205 11.832 14.568\" fill=\"transparent\" height=\"20px\" id=\"HuYXxzyXb\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(2 2)\" width=\"20px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"3009116499\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-tZ6rr\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-tZ6rr { -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 {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Phone Call\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-tZ6rr\");Icon.displayName=\"Phone Call\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerIntrinsicWidth\":\"24\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerContractVersion\":\"1\",\"framerVector\":\"{\\\"name\\\":\\\"Phone Call\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useRef,useState}from\"react\";import{useReducedMotion}from\"framer-motion\";export function MobileCallButtonVisibility(Component){return /*#__PURE__*/forwardRef(function MobileCallButtonVisibilityOverride(props,ref){const prefersReducedMotion=useReducedMotion();const[isMobileViewport,setIsMobileViewport]=useState(false);const[isVisible,setIsVisible]=useState(false);const idleTimerRef=useRef(null);const heroBottomRef=useRef(0);const clearIdleTimer=useCallback(()=>{if(idleTimerRef.current!==null){window.clearTimeout(idleTimerRef.current);idleTimerRef.current=null;}},[]);const hideButton=useCallback(()=>{startTransition(()=>setIsVisible(false));},[]);const showButton=useCallback(()=>{startTransition(()=>setIsVisible(true));},[]);const getHeroElement=useCallback(()=>{if(typeof document===\"undefined\")return null;const prioritizedSelectors=[\"section[id*='hero' i]\",\"section[data-framer-name*='Hero' i]\",\"[data-framer-name*='Hero' i] section\",\"main section\",\"section\"];for(const selector of prioritizedSelectors){const found=document.querySelector(selector);if(found instanceof HTMLElement)return found;}return null;},[]);const updateHeroBoundary=useCallback(()=>{if(typeof window===\"undefined\")return;const heroElement=getHeroElement();if(!heroElement){heroBottomRef.current=0;return;}const rect=heroElement.getBoundingClientRect();heroBottomRef.current=rect.bottom+window.scrollY;},[getHeroElement]);const isWithinHero=useCallback(()=>{if(typeof window===\"undefined\")return true;const scrollTop=window.scrollY||window.pageYOffset||0;return scrollTop<Math.max(0,heroBottomRef.current-1);},[]);const scheduleRevealAfterIdle=useCallback(()=>{if(typeof window===\"undefined\")return;clearIdleTimer();idleTimerRef.current=window.setTimeout(()=>{updateHeroBoundary();if(!isWithinHero()){showButton();}},2700);},[clearIdleTimer,isWithinHero,showButton,updateHeroBoundary]);useEffect(()=>{if(typeof window===\"undefined\")return;const updateViewportState=()=>{const mobile=window.innerWidth<=809;startTransition(()=>setIsMobileViewport(mobile));if(!mobile){clearIdleTimer();return;}updateHeroBoundary();hideButton();if(!isWithinHero()){scheduleRevealAfterIdle();}};updateViewportState();window.addEventListener(\"resize\",updateViewportState);return()=>{window.removeEventListener(\"resize\",updateViewportState);};},[clearIdleTimer,hideButton,isWithinHero,scheduleRevealAfterIdle,updateHeroBoundary]);useEffect(()=>{if(typeof window===\"undefined\"||!isMobileViewport)return;const onScroll=()=>{updateHeroBoundary();hideButton();clearIdleTimer();if(isWithinHero())return;scheduleRevealAfterIdle();};onScroll();window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",onScroll);clearIdleTimer();};},[clearIdleTimer,hideButton,isMobileViewport,isWithinHero,scheduleRevealAfterIdle,updateHeroBoundary]);if(!isMobileViewport){return /*#__PURE__*/_jsx(Component,{ref:ref,...props});}return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,pointerEvents:isVisible?props.style?.pointerEvents??\"auto\":\"none\"},initial:false,animate:isVisible?{opacity:1,scale:1}:{opacity:0,scale:prefersReducedMotion?1:.92},transition:prefersReducedMotion?{duration:.01}:{duration:.35,ease:[.22,1,.36,1]}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"MobileCallButtonVisibility\":{\"type\":\"reactHoc\",\"name\":\"MobileCallButtonVisibility\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MobileCallButtonVisibility.map"],"mappings":"A,iWACgM,EAAK,0BAAgC,EAAkB,gBAAW,SAAS,EAAM,EAAI,CAAC,MAAoB,gBAAK,MAAM,CAAC,GAAGgC,EAAU,MAAI,SAASA,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAUf,EAAO,OAAOQ,CAAI,EAAQ,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAA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