{"version":3,"file":"Examples.C5imhzdm.mjs","names":["React.useState","React.useRef","React.useCallback","React.useMemo"],"sources":["https:/framerusercontent.com/modules/syZKMEaBvrjoidfdPzJQ/MRXjBRRZ22rEcHVesHFR/Examples.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{ControlType}from\"framer\";// Learn more: https://www.framer.com/docs/guides/overrides/\nfunction createStore(initial){let store=initial;const listeners=new Set;return function useStore(){const[snapshot,setSnapshot]=React.useState(store);React.useEffect(()=>{listeners.add(setSnapshot);return()=>{listeners.delete(setSnapshot);};},[]);const setStore=patch=>{store={...store,...patch};listeners.forEach(listener=>listener(store));};return[snapshot,setStore];};}function randomColor(){return`hsl(${Math.floor(Math.random()*360)}, 80%, 58%)`;}const 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.05}});};}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 withVimeoIframeCover(Component){return /*#__PURE__*/React.forwardRef(function WithVimeoIframeCover(props,ref){const{scaleX=1.08,scaleY=1.08,style,...rest}=props;const wrapperRef=React.useRef(null);const setRefs=React.useCallback(node=>{wrapperRef.current=node;if(typeof ref===\"function\")ref(node);else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);React.useEffect(()=>{if(typeof window===\"undefined\")return;const root=wrapperRef.current;if(!root)return;const targets=root.querySelectorAll(\"iframe, video, embed\");targets.forEach(element=>{const htmlElement=element;htmlElement.style.position=\"absolute\";htmlElement.style.left=\"50%\";htmlElement.style.top=\"50%\";htmlElement.style.width=\"100%\";htmlElement.style.height=\"100%\";htmlElement.style.transform=`translate(-50%, -50%) scale(${scaleX}, ${scaleY})`;htmlElement.style.transformOrigin=\"center center\";htmlElement.style.pointerEvents=\"auto\";});},[scaleX,scaleY]);const mergedStyle=React.useMemo(()=>({...style,position:style?.position??\"relative\",overflow:\"hidden\",pointerEvents:style?.pointerEvents??\"auto\"}),[style]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...rest,style:mergedStyle});});}withVimeoIframeCover.propertyControls={scaleX:{type:ControlType.Number,title:\"Scale X\",defaultValue:1.08,min:1,max:1.5,step:.01},scaleY:{type:ControlType.Number,title:\"Scale Y\",defaultValue:1.08,min:1,max:1.5,step:.01}};export function withShowAfterHeroScroll(Component){return /*#__PURE__*/React.forwardRef(function WithShowAfterHeroScroll(props,ref){const{threshold=650,visibleOffsetY=0,hiddenOffsetY=18,duration=.3,style,...rest}=props;const[isVisible,setIsVisible]=React.useState(false);const prefersReducedMotion=React.useMemo(()=>{if(typeof window===\"undefined\")return false;return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;},[]);const updateVisibility=React.useCallback(()=>{if(typeof window===\"undefined\")return;const shouldShow=window.scrollY>threshold;React.startTransition(()=>{setIsVisible(previous=>previous===shouldShow?previous:shouldShow);});},[threshold]);React.useEffect(()=>{if(typeof window===\"undefined\")return;updateVisibility();window.addEventListener(\"scroll\",updateVisibility,{passive:true});window.addEventListener(\"resize\",updateVisibility);return()=>{window.removeEventListener(\"scroll\",updateVisibility);window.removeEventListener(\"resize\",updateVisibility);};},[updateVisibility]);const mergedStyle=React.useMemo(()=>({...style,opacity:isVisible?1:0,transform:`${style?.transform?`${style.transform} `:\"\"}translateY(${isVisible?visibleOffsetY:hiddenOffsetY}px)`,pointerEvents:isVisible?style?.pointerEvents:\"none\",transition:prefersReducedMotion?undefined:`opacity ${duration}s ease, transform ${duration}s ease`,willChange:\"opacity, transform\"}),[style,isVisible,visibleOffsetY,hiddenOffsetY,duration,prefersReducedMotion]);return /*#__PURE__*/_jsx(Component,{ref:ref,...rest,style:mergedStyle});});}withShowAfterHeroScroll.propertyControls={threshold:{type:ControlType.Number,title:\"Threshold\",defaultValue:650,min:0,max:3e3,step:10,unit:\"px\"},visibleOffsetY:{type:ControlType.Number,title:\"Visible Y\",defaultValue:0,min:-300,max:300,step:1,unit:\"px\"},hiddenOffsetY:{type:ControlType.Number,title:\"Hidden Y\",defaultValue:18,min:-300,max:300,step:1,unit:\"px\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.3,min:0,max:2,step:.05,unit:\"s\"}};export function ResponsiveVideoAspect(Component){return /*#__PURE__*/React.forwardRef(function ResponsiveVideoAspectOverride(props,ref){const mergedStyle=React.useMemo(()=>({...props.style,position:props.style?.position??\"relative\",width:\"100%\",maxWidth:\"100%\",height:\"auto\",minHeight:0,aspectRatio:\"16 / 9\",overflow:\"visible\"}),[props.style]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:mergedStyle});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withVimeoIframeCover\":{\"type\":\"reactHoc\",\"name\":\"withVimeoIframeCover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ResponsiveVideoAspect\":{\"type\":\"reactHoc\",\"name\":\"ResponsiveVideoAspect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withShowAfterHeroScroll\":{\"type\":\"reactHoc\",\"name\":\"withShowAfterHeroScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"2NAC8+B,SAAgB,EAAqB,EAAU,CAAC,OAAoB,EAAiB,SAA8B,EAAM,EAAI,CAAC,GAAK,CAAC,SAAO,KAAK,SAAO,KAAK,QAAM,GAA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