{"version":3,"file":"Examples.B4FmL5RD.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/al7f4YOQbl6nRYr04Dwd/DvXUrIxFIYnd1lOB9HB1/Examples.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}function parseNumericText(value){const normalized=value.trim();const match=normalized.match(/^(.*?)(-?\\d[\\d,]*(?:\\.\\d+)?)(.*?)$/);if(!match)return null;const[,prefix,numericPart,suffix]=match;const hasCommas=numericPart.includes(\",\");const decimals=numericPart.includes(\".\")?numericPart.split(\".\")[1]?.length??0:0;const numericValue=Number.parseFloat(numericPart.replace(/,/g,\"\"));if(!Number.isFinite(numericValue))return null;return{prefix,suffix,numericValue,hasCommas,decimals};}function findDeepestTextElement(root){let current=root;while(current.children.length>0){const next=Array.from(current.children).find(child=>{return child instanceof HTMLElement&&typeof child.textContent===\"string\"&&child.textContent.trim().length>0;});if(!(next instanceof HTMLElement))break;current=next;}return current;}export function withCountUp(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{duration=2,delay=0,children,...restProps}=props;const isStaticRenderer=useIsStaticRenderer();const elementRef=useRef(null);const hasAnimatedRef=useRef(false);useEffect(()=>{if(isStaticRenderer||typeof window===\"undefined\")return;if(typeof document===\"undefined\"||!elementRef.current)return;if(hasAnimatedRef.current)return;let observer=null;let timeoutId=null;let rafId=null;try{const prefersReducedMotion=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\")?.matches;if(prefersReducedMotion)return;const rootElement=elementRef.current;if(!rootElement)return;const textElement=findDeepestTextElement(rootElement);const originalText=textElement.textContent??\"\";const parsed=parseNumericText(originalText);if(!parsed)return;const formatter=new Intl.NumberFormat(undefined,{minimumFractionDigits:parsed.decimals,maximumFractionDigits:parsed.decimals,useGrouping:parsed.hasCommas});const formatValue=value=>{return`${parsed.prefix}${formatter.format(value)}${parsed.suffix}`;};const finalText=formatValue(parsed.numericValue);if(typeof IntersectionObserver===\"undefined\"){textElement.textContent=finalText;return;}const easeOutCubic=t=>1-Math.pow(1-t,3);const runAnimation=()=>{const totalDurationMs=Math.max(0,duration*1e3);const safeDelayMs=Math.max(0,delay*1e3);const start=()=>{if(totalDurationMs<=0){textElement.textContent=finalText;hasAnimatedRef.current=true;return;}textElement.textContent=formatValue(0);let startTime=0;const animate=timestamp=>{if(!startTime)startTime=timestamp;const elapsed=timestamp-startTime;const progress=Math.min(elapsed/totalDurationMs,1);const easedProgress=easeOutCubic(progress);const currentValue=parsed.numericValue*easedProgress;textElement.textContent=formatValue(currentValue);if(progress<1){rafId=window.requestAnimationFrame(animate);}else{textElement.textContent=finalText;hasAnimatedRef.current=true;}};rafId=window.requestAnimationFrame(animate);};if(safeDelayMs>0){timeoutId=window.setTimeout(start,safeDelayMs);}else{start();}};observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&entry.intersectionRatio>=.3&&!hasAnimatedRef.current){runAnimation();observer?.disconnect();}});},{threshold:[.3]});observer.observe(rootElement);}catch{return;}return()=>{if(observer)observer.disconnect();if(typeof window!==\"undefined\"){if(timeoutId!==null)window.clearTimeout(timeoutId);if(rafId!==null)window.cancelAnimationFrame(rafId);}};},[duration,delay,isStaticRenderer,children]);return /*#__PURE__*/_jsx(Component,{ref:node=>{elementRef.current=node;if(typeof ref===\"function\")ref(node);else if(ref&&\"current\"in ref){ref.current=node;}},...restProps,children:children});});}addPropertyControls(withCountUp,{duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:0,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCountUp\":{\"type\":\"reactHoc\",\"name\":\"withCountUp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"oOAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,EACjD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,CAAQ,CAAC,CAAE,EACjI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,EAAE,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,CAAU,GAAG,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,CAAQ,CAAC,EAAE,EACjJ,EAAa,QAAQ,GAAQ,EAAO,CAAU,CAAC,CAAE,EACjD,SAAS,GAAU,CACnB,GAAK,CAAC,EAAM,GAAUA,EAAS,CAAU,EAKzC,OAHA,OACA,EAAa,IAAI,CAAQ,MAAY,EAAa,OAAO,CAAQ,GAAI,CAAC,CAAC,EACpE,EAAe,IAAI,IAAM,EAAe,EAAQ,CAAC,EAAU,MAAM,CAAY,GAC1E,CAAC,EAAM,CAAa,CAAG,CAAC,OAAO,CAAS,iBAfT,IAAwC,kCEAhE,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EAWI,CADA,GAAG,CACO,sBEd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