{"version":3,"file":"Examples.BTAPYzEl.mjs","names":["useState","useRef","useMemo","useCallback","__esmMin","init_ssg_sandbox_shims","ne","window","_e","de","pe","c","J","init_jsx_runtime","init_npm_react_18_3_1","ce","init_framer_BWFVvmND","useIsStaticRenderer","Data","useObserveData","createStore","dataStore","state1","setDataStore","newState","storeState","storeSetters","setStoreState","setter","useStore","state","setState","init_createStore","init_store_js__1_0","centerContent","init_Utils","init_utils_js__0_9","withDragToScroll","isStatic","movedResetTimer","dragState","interactiveSelector","onPointerDown","props","event","element","onPointerMove","deltaX","endDrag","onPointerUp","onPointerCancel","onClickCapture","onDragStart","Component","init_Examples"],"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/1lRyBB6DZPud2DF5Xvdj/Ms5csAe5xoSB0VRsLiU7/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,useCallback,useEffect,useMemo,useRef}from\"react\";import{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()});}});});}export function withDragToScroll(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isStatic=useIsStaticRenderer();const movedResetTimer=useRef(null);const dragState=useRef({isPointerDown:false,isDragging:false,pointerId:-1,startX:0,startScrollLeft:0,moved:false});useEffect(()=>{return()=>{if(typeof window!==\"undefined\"&&movedResetTimer.current!==null){window.clearTimeout(movedResetTimer.current);movedResetTimer.current=null;}if(typeof document!==\"undefined\"){document.body.style.userSelect=\"\";}};},[]);const interactiveSelector=useMemo(()=>[\"a\",\"button\",\"input\",\"select\",\"textarea\",\"label\",\"[role='button']\",\"[role='link']\",\"[data-no-drag-scroll='true']\"].join(\",\"),[]);const onPointerDown=useCallback(event=>{props.onPointerDown?.(event);if(event.defaultPrevented||isStatic)return;if(event.pointerType!==\"mouse\"&&event.pointerType!==\"pen\")return;if(event.button!==0)return;const target=event.target;if(target?.closest(interactiveSelector))return;const element=event.currentTarget;dragState.current.isPointerDown=true;dragState.current.isDragging=false;dragState.current.pointerId=event.pointerId;dragState.current.startX=event.clientX;dragState.current.startScrollLeft=element.scrollLeft;dragState.current.moved=false;},[interactiveSelector,isStatic,props]);const onPointerMove=useCallback(event=>{props.onPointerMove?.(event);if(event.defaultPrevented||isStatic)return;const state=dragState.current;if(!state.isPointerDown||event.pointerId!==state.pointerId)return;const element=event.currentTarget;const deltaX=event.clientX-state.startX;if(!state.isDragging&&Math.abs(deltaX)>3){state.isDragging=true;try{element.setPointerCapture(event.pointerId);}catch(_){}}if(!state.isDragging)return;state.moved=true;element.scrollLeft=state.startScrollLeft-deltaX;element.style.cursor=\"grabbing\";if(typeof document!==\"undefined\"){document.body.style.userSelect=\"none\";}event.preventDefault();},[isStatic,props]);const endDrag=useCallback(event=>{const element=event.currentTarget;const state=dragState.current;if(state.isPointerDown&&event.pointerId===state.pointerId){state.isPointerDown=false;state.pointerId=-1;if(state.isDragging){try{element.releasePointerCapture(event.pointerId);}catch(_){}}state.isDragging=false;element.style.cursor=\"grab\";if(typeof document!==\"undefined\"){document.body.style.userSelect=\"\";}if(typeof window!==\"undefined\"&&state.moved&&movedResetTimer.current===null){movedResetTimer.current=window.setTimeout(()=>{dragState.current.moved=false;movedResetTimer.current=null;},0);}}},[]);const onPointerUp=useCallback(event=>{props.onPointerUp?.(event);if(event.defaultPrevented||isStatic)return;endDrag(event);},[endDrag,isStatic,props]);const onPointerCancel=useCallback(event=>{props.onPointerCancel?.(event);if(event.defaultPrevented||isStatic)return;endDrag(event);},[endDrag,isStatic,props]);const onClickCapture=useCallback(event=>{props.onClickCapture?.(event);if(event.defaultPrevented||isStatic)return;if(dragState.current.moved){event.preventDefault();event.stopPropagation();dragState.current.moved=false;}},[isStatic,props]);const onDragStart=useCallback(event=>{props.onDragStart?.(event);if(event.defaultPrevented||isStatic)return;if(dragState.current.isPointerDown||dragState.current.isDragging){event.preventDefault();}},[isStatic,props]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,cursor:props.style?.cursor??\"grab\",touchAction:props.style?.touchAction??\"auto\"},onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:onPointerUp,onPointerCancel:onPointerCancel,onClickCapture:onClickCapture,onDragStart:onDragStart});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDragToScroll\":{\"type\":\"reactHoc\",\"name\":\"withDragToScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"A,oOAA8E,SAAgBoB,EAAY,EAAO,CACjH,IAAMC,EAAUH,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGI,CAAM,CAAC,CAAC,CAAC,EACjDC,EAAa,GAAU,CAC1B,OAAOC,GAAW,aAAY,EAASA,EAASH,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOH,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DI,kBAAa,IAAI,IACjBC,EAAc,GAAU,CAC3B,OAAOH,GAAW,aAAY,EAASA,EAASC,CAAU,GAAG,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQ,GAAQE,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,GAAU/B,EAASyB,CAAU,EAKzC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