{"version":3,"file":"TodayFilter.CugO2LtY.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","_e","de","init_jsx_runtime","J","c","ce","withTodayDate","now","todayFormatted","Component","props","withHideWhenNoTechLunch","ref","hidden","setHidden","el","check","observer","setRef","node","forwardedRef","init_TodayFilter"],"sources":["https:/framerusercontent.com/modules/21xjKxOttQAx73O5eY1D/UNniVVtCleIOsdG9batc/TodayFilter.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef,useState}from\"react\";export function withTodayDate(Component){return props=>{// Genera la data odierna nel formato YYYY-MM-DD compatibile con Google Sheets\nconst now=new Date;const year=now.getFullYear();const month=String(now.getMonth()+1).padStart(2,\"0\");const day=String(now.getDate()).padStart(2,\"0\");const todayFormatted=`${year}-${month}-${day}`;return /*#__PURE__*/_jsx(Component,{...props,today:todayFormatted});};}/**\n * Hides the section it is applied to when it contains no upcoming Tech Lunch card\n * (the repeated item named \"Next tech lunch item\" in the Next Tech Lunch component).\n */export function withHideWhenNoTechLunch(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const ref=useRef(null);const[hidden,setHidden]=useState(false);useEffect(()=>{const el=ref.current;if(!el)return;const check=()=>setHidden(!el.querySelector('[data-framer-name=\"Next tech lunch item\"]'));check();const observer=new MutationObserver(check);observer.observe(el,{childList:true,subtree:true});return()=>observer.disconnect();},[]);const setRef=node=>{ref.current=node;if(typeof forwardedRef===\"function\")forwardedRef(node);else if(forwardedRef)forwardedRef.current=node;};return /*#__PURE__*/_jsx(Component,{...props,ref:setRef,style:{...props.style,...hidden?{display:\"none\"}:{}}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withTodayDate\":{\"type\":\"reactHoc\",\"name\":\"withTodayDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHideWhenNoTechLunch\":{\"type\":\"reactHoc\",\"name\":\"withHideWhenNoTechLunch\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetad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