{"version":3,"file":"Examples.BH-edcAl.mjs","names":["useState","useState","useRef","useMemo","Children"],"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/6ATrIvCRcH2uI0HMRorQ/IonMqoilCXkM9KYmEXku/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,jsxs as _jsxs}from\"react/jsx-runtime\";import{Children,forwardRef,isValidElement,startTransition,useMemo,useRef,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";// @ts-expect-error Framer runtime URL import\nimport{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// @ts-expect-error Framer runtime URL import\nimport{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()});}});});}// Core factory: takes fixed speed/direction and returns an override\nfunction createTickerOverride(defaultSpeed,defaultDirection){return function(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const{speed=defaultSpeed,direction=defaultDirection,gap=8,children,style,...rest}=props;const isStatic=useIsStaticRenderer();const[isHovered,setIsHovered]=useState(false);const viewportRef=useRef(null);const isInView=useInView(viewportRef,{amount:.1});const childrenArray=useMemo(()=>Children.toArray(children),[children]);const duplicatedChildren=useMemo(()=>[...childrenArray,...childrenArray],[childrenArray]);const groupWidthEstimate=useMemo(()=>{if(childrenArray.length===0)return 1;return childrenArray.length*200+(childrenArray.length-1)*gap;},[childrenArray,gap]);const duration=useMemo(()=>{const safeSpeed=Math.max(1,speed);return groupWidthEstimate/safeSpeed;},[groupWidthEstimate,speed]);const playState=!isStatic&&isInView&&!isHovered?\"running\":\"paused\";const initialX=direction===\"Left\"?\"0%\":\"-50%\";const finalX=direction===\"Left\"?\"-50%\":\"0%\";return /*#__PURE__*/_jsxs(Component,{ref:ref,...rest,style:{...style,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                            @keyframes framerTickerScroll {\n                                from { transform: translate3d(${initialX}, 0, 0); }\n                                to { transform: translate3d(${finalX}, 0, 0); }\n                            }\n                        `}),/*#__PURE__*/_jsx(\"div\",{ref:viewportRef,onMouseEnter:()=>{startTransition(()=>setIsHovered(true));},onMouseLeave:()=>{startTransition(()=>setIsHovered(false));},style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",width:\"max-content\",gap:`${gap}px`,animationName:\"framerTickerScroll\",animationDuration:`${duration}s`,animationTimingFunction:\"linear\",animationIterationCount:\"infinite\",animationPlayState:playState,willChange:\"transform\"},children:duplicatedChildren.map((child,index)=>{if(!/*#__PURE__*/isValidElement(child))return child;return /*#__PURE__*/_jsx(\"div\",{style:{flex:\"none\"},children:child},`ticker-item-${index}`);})})})]});});};}// Generic override (kept as-is, in case you still need manual control anywhere)\nexport function withTickerAnimation(Component){return createTickerOverride(20,\"Left\")(Component);}// Row 1 & Row 3: speed 35, Right to Left\nexport const withTickerRow1=createTickerOverride(35,\"Left\");export const withTickerRow3=createTickerOverride(35,\"Left\");// Row 2 & Row 4: speed 30, Left to Right\nexport const withTickerRow2=createTickerOverride(30,\"Right\");export const withTickerRow4=createTickerOverride(30,\"Right\");\nexport const __FramerMetadata__ = {\"exports\":{\"withTickerRow1\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTickerRow4\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTickerRow2\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTickerAnimation\":{\"type\":\"reactHoc\",\"name\":\"withTickerAnimation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTickerRow3\":{\"type\":\"variable\",\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