{"version":3,"file":"ProjectFilterRefresh.DEIBHkFH.mjs","names":["useRef","_Fragment","useState"],"sources":["https:/framerusercontent.com/modules/ScrqFTp2A5QNBd2PSlxU/dp3JeAJNhTWvbXiwjO6x/ProjectFilterRefresh.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef,useState}from\"react\";// Keep the filter interaction native and immediate.\nexport function withFilterRefresh(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{...props,ref:ref}));}// Existing tiles stay mounted; only newly added tiles use their canvas appear effect.\nexport function withTileRefresh(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{...props,ref:ref}));}const GRID_STYLES=[\".sf-responsive-project-grid {\",\"    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;\",\"}\",\"\",\"@media (max-width: 1199.98px) {\",\"    .sf-responsive-project-grid {\",\"        grid-auto-rows: auto !important;\",\"    }\",\"\",\"    .sf-responsive-project-grid > * {\",\"        display: contents !important;\",\"        grid-column: auto !important;\",\"        grid-row: auto !important;\",\"    }\",\"}\",\"\",\"@media (min-width: 810px) and (max-width: 1199.98px) {\",\"    .sf-responsive-project-grid {\",\"        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\",\"    }\",\"}\",\"\",\"@media (max-width: 809.98px) {\",\"    .sf-responsive-project-grid {\",\"        grid-template-columns: minmax(0, 1fr) !important;\",\"    }\",\"}\"].join(\"\\n\");export function withResponsiveMasonryGrid(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const rootRef=useRef(null);useEffect(()=>{const root=rootRef.current;if(!root||typeof MutationObserver===\"undefined\")return;let frame=0;const applyOrder=()=>{frame=0;const columns=Array.from(root.children).filter(child=>child instanceof HTMLElement);const groups=columns.map(column=>Array.from(column.children).filter(child=>child instanceof HTMLElement));for(const group of groups){for(const card of group)card.style.removeProperty(\"order\");}if(!window.matchMedia(\"(max-width: 809.98px)\").matches)return;for(let column=0;column<groups.length;column+=1){const group=groups[column];for(let row=0;row<group.length;row+=1){group[row].style.setProperty(\"order\",String(row*groups.length+column),\"important\");}}};const schedule=()=>{if(frame)cancelAnimationFrame(frame);frame=requestAnimationFrame(applyOrder);};const observer=new MutationObserver(schedule);observer.observe(root,{childList:true,subtree:true});window.addEventListener(\"resize\",schedule);schedule();return()=>{observer.disconnect();window.removeEventListener(\"resize\",schedule);if(frame)cancelAnimationFrame(frame);};},[]);const setRootRef=node=>{rootRef.current=node;assignRef(forwardedRef,node);};const className=[props.className,\"sf-responsive-project-grid\"].filter(Boolean).join(\" \");return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:GRID_STYLES}),/*#__PURE__*/_jsx(Component,{...props,ref:setRootRef,className:className})]});});}function assignRef(ref,value){if(typeof ref===\"function\")ref(value);else if(ref&&typeof ref===\"object\")ref.current=value;}// When a visible tile video is present, size the existing media frame from\n// the video's real encoded dimensions. Image-only tiles keep Framer's\n// existing fit-image sizing.\nexport function withIntrinsicVideoAspect(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const rootRef=useRef(null);const[aspectRatio,setAspectRatio]=useState(null);useEffect(()=>{const root=rootRef.current;if(!root||typeof MutationObserver===\"undefined\")return;let activeVideo=null;let frame=0;const videoIsVisible=video=>{let element=video;while(element&&element!==root){const styles=window.getComputedStyle(element);if(styles.display===\"none\"||styles.visibility===\"hidden\"||Number(styles.opacity)===0){return false;}element=element.parentElement;}return true;};const updateRatio=()=>{frame=0;const video=root.querySelector(\"video\");activeVideo=video;if(!video||!videoIsVisible(video)||video.videoWidth<=0||video.videoHeight<=0){setAspectRatio(null);return;}setAspectRatio(video.videoWidth/video.videoHeight);};const scheduleUpdate=()=>{if(frame)cancelAnimationFrame(frame);frame=requestAnimationFrame(updateRatio);};const bindVideo=()=>{if(activeVideo){activeVideo.removeEventListener(\"loadedmetadata\",scheduleUpdate);activeVideo.removeEventListener(\"loadeddata\",scheduleUpdate);}activeVideo=root.querySelector(\"video\");if(activeVideo){activeVideo.addEventListener(\"loadedmetadata\",scheduleUpdate);activeVideo.addEventListener(\"loadeddata\",scheduleUpdate);}scheduleUpdate();};const observer=new MutationObserver(bindVideo);observer.observe(root,{subtree:true,childList:true,attributes:true,attributeFilter:[\"class\",\"src\",\"style\"]});bindVideo();return()=>{observer.disconnect();if(frame)cancelAnimationFrame(frame);if(activeVideo){activeVideo.removeEventListener(\"loadedmetadata\",scheduleUpdate);activeVideo.removeEventListener(\"loadeddata\",scheduleUpdate);}};},[]);const setRootRef=node=>{rootRef.current=node;assignRef(forwardedRef,node);};const intrinsicStyle=aspectRatio?{aspectRatio:String(aspectRatio),height:\"auto\"}:undefined;return /*#__PURE__*/_jsx(Component,{...props,ref:setRootRef,style:{...props.style,...intrinsicStyle}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withIntrinsicVideoAspect\":{\"type\":\"reactHoc\",\"name\":\"withIntrinsicVideoAspect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTileRefresh\":{\"type\":\"reactHoc\",\"name\":\"withTileRefresh\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withResponsiveMasonryGrid\":{\"type\":\"reactHoc\",\"name\":\"withResponsiveMasonryGrid\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFilterRefresh\":{\"type\":\"reactHoc\",\"name\":\"withFilterRefresh\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProjectFilterRefresh.map"],"mappings":"mKACA,SAAgB,EAAkB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAmB,EAAK,EAAU,CAAC,GAAG,EAAU,KAAG,CAAC,CAAC,CAAE,CAC1I,SAAgB,EAAgB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAmB,EAAK,EAAU,CAAC,GAAG,EAAU,KAAG,CAAC,CAAC,CAAE,C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