{"version":3,"file":"Examples.C1H1L09J.mjs","names":["useState","useMemo"],"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/7S1zqBWkqzIVHt2iEsP0/d0JKULtsAMhXZpUYS0A7/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,useMemo}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\";const 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 withBackToWorkDropShadow(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,textShadow:\"0px 2px 12px rgba(0, 0, 0, 0.45)\",filter:\"drop-shadow(0px 2px 8px rgba(0,0,0,0.35))\",userSelect:\"none\",WebkitUserSelect:\"none\"}});});}const defaultSmoothScrollSettings={enabled:true,speed:.15,acceleration:.05,damping:.95,maxSpeed:80,stopThreshold:.1};// 전역 싱글톤 설정 관리를 위한 모듈 변수\nlet smoothScrollRefCount=0;let cleanupGlobalSmoothScroll=null;let activeSettings=defaultSmoothScrollSettings;function isFormOrInteractiveTarget(target){if(!(target instanceof Element))return false;return!!target.closest(\"input, textarea, select, option, [contenteditable='true']\");}function hasScrollableAncestor(target,deltaY){if(!(target instanceof Element))return false;let el=target;while(el&&el!==document.body&&el!==document.documentElement){// 성능 최적화: scrollHeight가 clientHeight보다 클 때만 무겁게 스타일을 조회하도록 순서 변경\nif(el instanceof HTMLElement&&el.scrollHeight>el.clientHeight){const style=window.getComputedStyle(el);const overflowY=style.overflowY;const canScrollY=overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\";if(canScrollY){const atTop=el.scrollTop<=0;const atBottom=el.scrollTop+el.clientHeight>=el.scrollHeight-1;if(deltaY<0&&!atTop||deltaY>0&&!atBottom){return true;}}}el=el.parentElement;}return false;}function setupGlobalSmoothScroll(){let rafId=0;let velocity=0;const reducedMotionQuery=typeof window!==\"undefined\"?window.matchMedia(\"(prefers-reduced-motion: reduce)\"):null;const getMaxScrollTop=()=>Math.max(0,document.documentElement.scrollHeight-window.innerHeight);const stop=()=>{if(rafId){window.cancelAnimationFrame(rafId);rafId=0;}};const tick=()=>{const settings=activeSettings// 항상 최신 설정값을 참조\n;if(!settings.enabled){stop();return;}const maxScrollTop=getMaxScrollTop();const currentTop=window.scrollY;const nextTop=Math.max(0,Math.min(maxScrollTop,currentTop+velocity));window.scrollTo(0,nextTop);if(nextTop<=0&&velocity<0||nextTop>=maxScrollTop&&velocity>0){velocity=0;}else{velocity*=settings.damping;}if(Math.abs(velocity)<=settings.stopThreshold){velocity=0;stop();return;}rafId=window.requestAnimationFrame(tick);};const onWheel=event=>{const settings=activeSettings;if(!settings.enabled)return;if(reducedMotionQuery?.matches)return;if(event.ctrlKey)return;// 가로 스크롤 제스처(트랙패드 좌우 스크롤 등)는 부드러운 세로 스크롤 로직에서 제외\nif(Math.abs(event.deltaX)>Math.abs(event.deltaY))return;if(isFormOrInteractiveTarget(event.target))return;if(hasScrollableAncestor(event.target,event.deltaY))return;event.preventDefault();const normalizedDelta=event.deltaY;const boost=1+settings.acceleration*Math.min(3,Math.abs(normalizedDelta)/40);velocity+=normalizedDelta*settings.speed*boost;velocity=Math.max(-settings.maxSpeed,Math.min(settings.maxSpeed,velocity));if(!rafId){rafId=window.requestAnimationFrame(tick);}};window.addEventListener(\"wheel\",onWheel,{passive:false});return()=>{window.removeEventListener(\"wheel\",onWheel);stop();};}export function withAcceleratedSmoothScroll(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const resolvedSettings=useMemo(()=>({enabled:typeof props?.enabled===\"boolean\"?props.enabled:defaultSmoothScrollSettings.enabled,speed:typeof props?.speed===\"number\"?props.speed:defaultSmoothScrollSettings.speed,acceleration:typeof props?.acceleration===\"number\"?props.acceleration:defaultSmoothScrollSettings.acceleration,damping:typeof props?.damping===\"number\"?props.damping:defaultSmoothScrollSettings.damping,maxSpeed:typeof props?.maxSpeed===\"number\"?props.maxSpeed:defaultSmoothScrollSettings.maxSpeed,stopThreshold:typeof props?.stopThreshold===\"number\"?props.stopThreshold:defaultSmoothScrollSettings.stopThreshold}),[props?.enabled,props?.speed,props?.acceleration,props?.damping,props?.maxSpeed,props?.stopThreshold]);// 컴포넌트의 최신 설정을 전역 변수에 실시간 동기화\nuseEffect(()=>{activeSettings=resolvedSettings;},[resolvedSettings]);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;smoothScrollRefCount+=1;if(!cleanupGlobalSmoothScroll){cleanupGlobalSmoothScroll=setupGlobalSmoothScroll();}return()=>{smoothScrollRefCount-=1;if(smoothScrollRefCount<=0&&cleanupGlobalSmoothScroll){cleanupGlobalSmoothScroll();cleanupGlobalSmoothScroll=null;smoothScrollRefCount=0;}};},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withAcceleratedSmoothScroll\":{\"type\":\"reactHoc\",\"name\":\"withAcceleratedSmoothScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBackToWorkDropShadow\":{\"type\":\"reactHoc\",\"name\":\"withBackToWorkDropShadow\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"8MAA8E,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,GA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