{"version":3,"file":"Examples.C70QAx1N.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/Cb8J1JyF6GkOCzV0tdYh/htuKZEWBj8xpDRu5Rro2/Examples.js"],"sourcesContent":["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{useEffect,useState}from\"react\";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 props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.04}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}export function withContentEditable(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,contentEditable:true,autoFocus:true});};}export function withTypingAnimation(Component){return props=>{const[displayText,setDisplayText]=useState(\"\");const fullText=\"The quick brown fox jumps over the lazy dog.\";const[iteration,setIteration]=useState(0);const[charIndex,setCharIndex]=useState(0);useEffect(()=>{// If we've completed all 5 iterations, stop\nif(iteration>=5){return;}// If we've typed the full text for this iteration, start a new one\nif(charIndex>=fullText.length){setCharIndex(0);setDisplayText(prev=>prev+\" \");setIteration(iteration+1);return;}// Set a timeout to add the next character\nconst timeout=setTimeout(()=>{setDisplayText(prev=>prev+fullText.charAt(charIndex));setCharIndex(charIndex+1);},160);// Clean up the timeout when the component unmounts or the effect re-runs\nreturn()=>clearTimeout(timeout);},[charIndex,iteration]);// Use a more Framer-friendly approach to preserve styling\nreturn /*#__PURE__*/_jsx(Component,{...props,text:displayText,// This ensures we're setting text content while preserving styling\nanimate:{...props.animate}});};}export function withTextValueFromClicks(Component){return props=>{const[displayText,setDisplayText]=useState(props.text||\"a\");useEffect(()=>{// Function to handle clicks on any elements with class \"framer-text\"\nconst handleTextElementClick=e=>{// Get the clicked text content\nconst clickedText=e.target.textContent;if(clickedText){setDisplayText(clickedText);}};// Find all elements with class \"framer-text\"\nconst textElements=document.querySelectorAll(\".framer-text\");// Add click event listeners to each text element\ntextElements.forEach(element=>{element.addEventListener(\"click\",handleTextElementClick);});// Clean up event listeners when component unmounts\nreturn()=>{textElements.forEach(element=>{element.removeEventListener(\"click\",handleTextElementClick);});};},[]);return /*#__PURE__*/_jsx(Component,{...props,text:displayText});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTypingAnimation\":{\"type\":\"reactHoc\",\"name\":\"withTypingAnimation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContentEditable\":{\"type\":\"reactHoc\",\"name\":\"withContentEditable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextValueFromClicks\":{\"type\":\"reactHoc\",\"name\":\"withTextValueFromClicks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"iMAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,SACf,CAWG,CADA,GAAG,EACO,qBEdwL,SAAgB,EAAU,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAA+X,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAS,GAAG,CAAoE,CAAC,EAAU,GAAcA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAE,CAK77B,OAL87B,MAAc,CAC58B,GAAG,GAAW,EAAG,OACjB,GAAG,GAAW,GAAgB,CAAC,EAAa,EAAE,CAAC,EAAe,GAAM,EAAK,IAAI,CAAC,EAAa,EAAU,EAAE,CAAC,OACxG,IAAM,EAAQ,eAAe,CAAC,EAAe,GAAM,EAAK,+CAAS,OAAO,EAAU,CAAC,CAAC,EAAa,EAAU,EAAE,EAAG,IAAI,CACpH,UAAU,aAAa,EAAQ,EAAG,CAAC,EAAU,E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