{"version":3,"file":"QuickCount.C0ZDSo_b.mjs","names":["forwardRef","useRef","useCallback","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","ne","window","de","init_jsx_runtime","J","init_npm_react_18_3_1","ce","init_framer_ChujFWHC","isStaticRenderer","setComposedRef","ref","value","withQuickCount","Component","props","hostRef","hasAnimatedRef","hasStartedRef","startTimeRef","rafRef","setRef","node","root","walker","textNode","matchedParts","current","match","leading","target","trailing","reducedMotion","setValue","easeOutCubic","t","step","now","start","progress","eased","observer","entries","c","init_QuickCount"],"sources":["https:/framerusercontent.com/modules/cINPc3NASE7RdhByCs0z/E5Lw5ImWhv0pE0JQhbd8/QuickCount.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";import{isStaticRenderer}from\"framer\";function setComposedRef(ref,value){if(!ref)return;if(typeof ref===\"function\"){ref(value);return;}ref.current=value;}export function withQuickCount(Component){return /*#__PURE__*/forwardRef(function WithQuickCount(props,ref){const hostRef=useRef(null);const hasAnimatedRef=useRef(false);const hasStartedRef=useRef(false);const startTimeRef=useRef(null);const rafRef=useRef(null);const setRef=useCallback(node=>{hostRef.current=node;setComposedRef(ref,node);},[ref]);useEffect(()=>{if(typeof window===\"undefined\")return;if(isStaticRenderer())return;if(hasAnimatedRef.current)return;const root=hostRef.current;if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);let textNode=null;let matchedParts=null;while(walker.nextNode()){const current=walker.currentNode;if(!(current instanceof Text))continue;const source=current.nodeValue??\"\";const match=source.match(/^([^\\d]*)(\\d+)([^\\d]*)$/);if(!match)continue;const prefix=match[1]??\"\";if(prefix.includes(\"/\"))continue;if(match[2]){textNode=current;matchedParts=match;break;}}if(!textNode||!matchedParts)return;const leading=matchedParts[1]??\"\";const target=Number.parseInt(matchedParts[2]??\"100\",10)||100;const trailing=matchedParts[3]??\"\";const reducedMotion=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;const setValue=value=>{textNode.nodeValue=`${leading}${value}${trailing}`;};if(reducedMotion){setValue(target);hasAnimatedRef.current=true;return;}const duration=800;const easeOutCubic=t=>1-Math.pow(1-t,3);const step=now=>{const start=startTimeRef.current??now;const progress=Math.min(1,(now-start)/duration);const eased=easeOutCubic(progress);const value=Math.round(target*eased);setValue(value);if(progress<1){rafRef.current=window.requestAnimationFrame(step);}else{hasAnimatedRef.current=true;rafRef.current=null;}};const observer=new IntersectionObserver(entries=>{const entry=entries[0];if(!entry?.isIntersecting)return;observer.disconnect();if(hasAnimatedRef.current||hasStartedRef.current)return;hasStartedRef.current=true;startTimeRef.current=performance.now();setValue(0);rafRef.current=window.requestAnimationFrame(step);},{threshold:.2});observer.observe(root);return()=>{observer.disconnect();if(rafRef.current!==null){window.cancelAnimationFrame(rafRef.current);rafRef.current=null;}};},[]);return /*#__PURE__*/_jsx(Component,{ref:setRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withQuickCount\":{\"type\":\"reactHoc\",\"name\":\"withQuickCount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./QuickCount.map"],"mappings":"A,iMAA2I,SAASgB,EAAeC,EAAIC,EAAM,CAAKD,IAAc,OAAOA,GAAM,WAAYA,EAAIC,CAAK,EAAUD,EAAI,QAAQC,EAAM,CAAC,SAAgBC,EAAeC,EAAU,CAAC,MAAoBpB,gBAAW,SAAwBqB,EAAMJ,EAAI,CAAC,IAAMK,EAAQrB,EAAO,IAAI,EAAQsB,EAAetB,EAAO,EAAK,EAAQuB,EAAcvB,EAAO,EAAK,EAAQwB,EAAaxB,EAAO,IAAI,EAAQyB,EAAOzB,EAAO,IAAI,EAAQ0B,EAAOzB,EAAY0B,GAAM,CAACN,EAAQ,QAAQM,EAAKZ,EAAeC,EAAIW,CAAI,CAAE,EAAE,CAACX,CAAG,CAAC,EAA8yD,OAA5yDd,MAAc,CAAoE,GAAzDK,IA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