{"version":3,"file":"UtilityOverrides.DIWa3uiK.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/0n8lAoZmGIKTGOSrztxX/84IJvPad7wKaGINQzjUs/UtilityOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useLayoutEffect,useRef,useState}from\"react\";import{useInView}from\"framer-motion\";// Learn more: https://www.framer.com/docs/guides/overrides/\nexport function withLogProps(Component){return props=>{console.log(props);return /*#__PURE__*/_jsx(Component,{...props,className:\"Test log props\",onClick:console.log(\"Hello World\",props.link)});};}export function withABVariantButton(Component){const STORAGE_KEY=\"current-variant-homepage-vertical-type\";return props=>{const[buttonText,setButtonText]=useState(\"Learn more\");const containerRef=useRef(null);function stripParams(url){return url.split(/[?#]/)[0];}const linkToTextMapping={\"/solutions/private-equity\":\"Explore PE solutions\",\"/solutions/ma-advisors\":\"Explore M&A solutions\",\"/solutions/consultants\":\"Explore Consultants solutions\",\"/solutions/strategy-ma\":\"Explore Corporate M&A solutions\",\"/solutions/law-firms\":\"Explore Law Firms solutions\",\"/solutions/executive-search\":\"Explore Executive Search solutions\"};const onButtonClick=()=>{if(Array.isArray(window.dataLayer)){let variant=localStorage.getItem(STORAGE_KEY);window.dataLayer.push({event:`homepage_vertical_solution_button_click_${props?.link?variant:\"A\"}`,event_category:\"Homepage vertical solution button click\",event_label:`Variant ${variant}`,non_interaction:true});}};useLayoutEffect(()=>{if(props?.link){// 1. Get or set the variant in localStorage\nlet variant=localStorage.getItem(STORAGE_KEY);if(!variant){variant=\"A\";localStorage.setItem(STORAGE_KEY,variant);}// 2. Target the text element deep inside the Framer component\nif(containerRef.current){const textElement=containerRef.current.querySelector(\".framer-text\");if(textElement){// 3. Directly update the text content based on the variant\ntextElement.textContent=variant===\"B\"?linkToTextMapping[stripParams(props?.link)]||\"Learn more\":\"Learn more\";if(Array.isArray(window.dataLayer)){let variant=localStorage.getItem(STORAGE_KEY);window.dataLayer.push({event:`homepage_vertical_solution_button_render_${props?.link?variant:\"A\"}`,event_category:\"Homepage vertical solution button render\",event_label:`Variant ${variant}`,non_interaction:true});}}}}},[props?.link])// Runs once on mount\n;return /* display: contents ensures this wrapper doesn't break Framer's styles *//*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props,onClick:onButtonClick})});};}export function withLifeAtGainProCarouselNavigationPosition(Component){return props=>{// 1. We attach the ref to a wrapper <div> we control, guaranteeing it's never null\nconst containerRef=useRef(null);const isTablet=window?.innerWidth<=1199;useLayoutEffect(()=>{const container=containerRef.current;if(!container)return;// --- A. Set Container to Relative ---\n// The wrapper div becomes the boundary for absolute positioning\ncontainer.style.position=\"relative\";// Optional: Ensure the container fills space so the layout doesn't collapse\ncontainer.style.height=\"100%\";container.style.width=\"100%\";// --- B. Find the Buttons ---\n// We search inside our container. Since Component is a child,\n// querySelector will find its buttons.\nconst prevBtn=container.querySelector('button[aria-label=\"Previous\"]');const nextBtn=container.querySelector('button[aria-label=\"Next\"]');if(!prevBtn||!nextBtn)return;// Prevention: Check if wrapper already exists to avoid duplication\nif(prevBtn.parentNode.getAttribute(\"data-nav-wrapper\"))return;// --- C. Create the Button Wrapper ---\nconst navWrapper=document.createElement(\"div\");navWrapper.setAttribute(\"data-nav-wrapper\",\"true\");// --- D. Style: Absolute Bottom Left + Gap ---\nObject.assign(navWrapper.style,{position:\"absolute\",bottom:\"0px\",left:isTablet?\"-374px\":\"-410px\",display:\"flex\",gap:\"16px\",padding:\"12px\",zIndex:\"100\"});// --- E. Move Buttons ---\nnavWrapper.appendChild(prevBtn);navWrapper.appendChild(nextBtn);container.appendChild(navWrapper);},[]);return(// We wrap Component in a div so we can reliably attach the ref\n/*#__PURE__*/_jsx(\"div\",{ref:containerRef,className:\"hoc-wrapper\",children:/*#__PURE__*/_jsx(Component,{...props,className:\"Test log props\",// Fixed the console.log to run on click, not on render\nonClick:()=>console.log(\"Hello World\",props.link)})}));};}export function withCarouselBottomLeftPosition(Component){return props=>{// 1. We attach the ref to a wrapper <div> we control, guaranteeing it's never null\nconst containerRef=useRef(null);useLayoutEffect(()=>{const container=containerRef.current;if(!container)return;// --- A. Set Container to Relative ---\n// The wrapper div becomes the boundary for absolute positioning\ncontainer.style.position=\"relative\";// Optional: Ensure the container fills space so the layout doesn't collapse\ncontainer.style.height=\"100%\";container.style.width=\"100%\";// --- B. Find the Buttons ---\n// We search inside our container. Since Component is a child,\n// querySelector will find its buttons.\nconst prevBtn=container.querySelector('button[aria-label=\"Previous\"]');const nextBtn=container.querySelector('button[aria-label=\"Next\"]');if(!prevBtn||!nextBtn)return;// Prevention: Check if wrapper already exists to avoid duplication\nif(prevBtn.parentNode.getAttribute(\"data-nav-wrapper\"))return;// --- C. Create the Button Wrapper ---\nconst navWrapper=document.createElement(\"div\");navWrapper.setAttribute(\"data-nav-wrapper\",\"true\");// --- D. Style: Absolute Bottom Left + Gap ---\nObject.assign(navWrapper.style,{position:\"absolute\",bottom:\"0px\",left:\"0px\",display:\"flex\",gap:\"16px\",padding:\"12px\",zIndex:\"100\"});// --- E. Move Buttons ---\nnavWrapper.appendChild(prevBtn);navWrapper.appendChild(nextBtn);container.appendChild(navWrapper);},[]);return(// We wrap Component in a div so we can reliably attach the ref\n/*#__PURE__*/_jsx(\"div\",{ref:containerRef,className:\"hoc-wrapper\",children:/*#__PURE__*/_jsx(Component,{...props,className:\"Test log props\",// Fixed the console.log to run on click, not on render\nonClick:()=>console.log(\"Hello World\",props.link)})}));};}export function withHiddenContent(Component){return props=>{const cardCount=3;function hideChildrenCardWhenExceedsTheCount(){const filterElements=document.querySelectorAll(\".filter-cms-content-resource\");filterElements.forEach(parentNode=>{if(!parentNode)return;const children=Array.from(parentNode.children).filter(child=>!child.classList.contains(\"no-results-message\"));children.forEach((filterElement,index)=>{filterElement.style.display=index<cardCount?\"\":\"none\";});});}useLayoutEffect(()=>{hideChildrenCardWhenExceedsTheCount();},[]);return /*#__PURE__*/_jsx(Component,{...props});};}export function withFilterContent(Component){return props=>{const clsName=`${props.className} search-text-resource`;return /*#__PURE__*/_jsx(Component,{...props,className:clsName});};}export function withFilterContainer(Component){return props=>{const newCls=`${props.className} filter-cms-content-resource`;return /*#__PURE__*/_jsx(Component,{...props,className:newCls});};}export function withDeferredSectionRender(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const visibilityRef=useRef(null);const hasEnteredViewport=useInView(visibilityRef,{margin:\"200px 0px\",once:true});const[isDeferred,setIsDeferred]=useState(true);useLayoutEffect(()=>{if(hasEnteredViewport){startTransition(()=>setIsDeferred(false));}},[hasEnteredViewport]);return /*#__PURE__*/_jsx(\"div\",{ref:visibilityRef,style:{position:\"relative\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,overflow:\"visible\",contentVisibility:isDeferred?\"auto\":\"visible\",containIntrinsicSize:isDeferred?\"auto 1400px\":\"auto\"}})});});}export function lockPageScrollForMobileMenu(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const elementRef=useRef(null);const resizeObserverRef=useRef(null);const lockedContainersRef=useRef([]);const savedScrollYRef=useRef(0);const savedBodyStyleRef=useRef({overflow:\"\",position:\"\",top:\"\",left:\"\",right:\"\",width:\"\"});const savedHtmlOverflowRef=useRef(\"\");const hasSavedPageStateRef=useRef(false);const isScrollLockedRef=useRef(false);const setMergedRef=node=>{elementRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}};const lockExternalScrollableContainers=navigationElement=>{if(typeof window===\"undefined\")return;if(lockedContainersRef.current.length>0)return;const allElements=Array.from(document.body.querySelectorAll(\"*\"));const scrollableContainers=allElements.filter(element=>{if(element===navigationElement)return false;if(navigationElement.contains(element))return false;const computedStyle=window.getComputedStyle(element);const overflowY=computedStyle.overflowY;const canScrollY=overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\";return canScrollY&&element.scrollHeight>element.clientHeight;});lockedContainersRef.current=scrollableContainers.map(element=>({element,overflow:element.style.overflow,overflowY:element.style.overflowY,overscrollBehavior:element.style.overscrollBehavior,overscrollBehaviorY:element.style.overscrollBehaviorY,scrollTop:element.scrollTop}));lockedContainersRef.current.forEach(entry=>{entry.element.style.overflowY=\"hidden\";entry.element.style.overscrollBehavior=\"contain\";entry.element.style.overscrollBehaviorY=\"contain\";});};const unlockExternalScrollableContainers=()=>{lockedContainersRef.current.forEach(entry=>{entry.element.style.overflow=entry.overflow;entry.element.style.overflowY=entry.overflowY;entry.element.style.overscrollBehavior=entry.overscrollBehavior;entry.element.style.overscrollBehaviorY=entry.overscrollBehaviorY;entry.element.scrollTop=entry.scrollTop;});lockedContainersRef.current=[];};const unlockPageScroll=()=>{if(typeof window===\"undefined\")return;if(!isScrollLockedRef.current)return;unlockExternalScrollableContainers();document.body.style.overflow=savedBodyStyleRef.current.overflow;document.body.style.position=savedBodyStyleRef.current.position;document.body.style.top=savedBodyStyleRef.current.top;document.body.style.left=savedBodyStyleRef.current.left;document.body.style.right=savedBodyStyleRef.current.right;document.body.style.width=savedBodyStyleRef.current.width;document.documentElement.style.overflow=savedHtmlOverflowRef.current;window.scrollTo(0,savedScrollYRef.current);isScrollLockedRef.current=false;hasSavedPageStateRef.current=false;};const evaluateMenuState=()=>{if(typeof window===\"undefined\")return;const navigationElement=elementRef.current;if(!navigationElement){unlockPageScroll();return;}const isPhoneViewport=window.innerWidth<810;const isExpanded=navigationElement.getBoundingClientRect().height>64;const shouldLockPageScroll=isPhoneViewport&&isExpanded;if(shouldLockPageScroll){if(!hasSavedPageStateRef.current){savedScrollYRef.current=window.scrollY||window.pageYOffset||0;savedBodyStyleRef.current={overflow:document.body.style.overflow,position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,right:document.body.style.right,width:document.body.style.width};savedHtmlOverflowRef.current=document.documentElement.style.overflow;hasSavedPageStateRef.current=true;}if(!isScrollLockedRef.current){document.body.style.overflow=\"hidden\";document.body.style.position=\"fixed\";document.body.style.top=`-${savedScrollYRef.current}px`;document.body.style.left=\"0\";document.body.style.right=\"0\";document.body.style.width=\"100%\";document.documentElement.style.overflow=\"hidden\";lockExternalScrollableContainers(navigationElement);isScrollLockedRef.current=true;}}else{unlockPageScroll();}};useLayoutEffect(()=>{if(typeof window===\"undefined\")return;evaluateMenuState();const navigationElement=elementRef.current;if(navigationElement&&typeof ResizeObserver!==\"undefined\"){resizeObserverRef.current=new ResizeObserver(()=>{evaluateMenuState();});resizeObserverRef.current.observe(navigationElement);}const onResize=()=>evaluateMenuState();window.addEventListener(\"resize\",onResize);return()=>{window.removeEventListener(\"resize\",onResize);resizeObserverRef.current?.disconnect();resizeObserverRef.current=null;unlockPageScroll();};},[]);useLayoutEffect(()=>{evaluateMenuState();});return /*#__PURE__*/_jsx(Component,{ref:setMergedRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withLogProps\":{\"type\":\"reactHoc\",\"name\":\"withLogProps\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"lockPageScrollForMobileMenu\":{\"type\":\"reactHoc\",\"name\":\"lockPageScrollForMobileMenu\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFilterContainer\":{\"type\":\"reactHoc\",\"name\":\"withFilterContainer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFilterContent\":{\"type\":\"reactHoc\",\"name\":\"withFilterContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLifeAtGainProCarouselNavigationPosition\":{\"type\":\"reactHoc\",\"name\":\"withLifeAtGainProCarouselNavigationPosition\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDeferredSectionRender\":{\"type\":\"reactHoc\",\"name\":\"withDeferredSectionRender\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withABVariantButton\":{\"type\":\"reactHoc\",\"name\":\"withABVariantButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCarouselBottomLeftPosition\":{\"type\":\"reactHoc\",\"name\":\"withCarouselBottomLeftPosition\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHiddenContent\":{\"type\":\"reactHoc\",\"name\":\"withHiddenContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UtilityOverrides.map"],"mappings":"6MAKmO,SAAgB,EAA4C,EAAU,CAAC,MAAO,IAAO,CACxT,IAAM,EAAaA,EAAO,IAAI,EAAQ,EAAS,GAAQ,YAAY,KAUqC,OAVhC,MAAoB,CAAC,IAAM,EAAU,EAAa,QAAQ,GAAG,CAAC,EAAU,OAEhJ,EAAU,MAAM,SAAS,WACzB,EAAU,MAAM,OAAO,OAAO,EAAU,MAAM,MAAM,OAGpD,IAAM,EAAQ,EAAU,cAAc,+BAA+B,EAAQ,EAAQ,EAAU,cAAc,2BAA2B,EACxI,GAD6I,CAAC,GAAS,CAAC,GACrJ,EAAQ,WAAW,aAAa,kBAAkB,EAAE,OACvD,IAAM,EAAW,SAAS,cAAc,KAAK,EAAE,EAAW,aAAa,mBAAmB,MAAM,EAChG,OAAO,OAAO,EAAW,MAAM,CAAC,SAAS,WAAW,OAAO,MAAM,KAAK,EAAS,SAAS,SAAS,QAAQ,OAAO,IAAI,OAAO,QAAQ,OAAO,OAAO,KAAK,CAAC,EACvJ,EAAW,YAAY,CAAO,EAAE,EAAW,YAAY,CAAO,EAAE,EAAU,YAAY,CAAU,CAAE,EAAE,CAAC,CAAC,EACzF,EAAK,MAAM,CAAC,IAAI,EAAa,UAAU,cAAc,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,UAAU,iBAC3H,YAAY,QAAQ,IAAI,cAAc,EAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAG,CAAE,CAAC,SAAgB,EAA+B,EAAU,CAAC,MAAO,IAAO,CAClI,IAAM,EAAaA,EAAO,IAAI,EAU0E,OAVxE,MAAoB,CAAC,IAAM,EAAU,EAAa,QAAQ,GAAG,CAAC,EAAU,OAExG,EAAU,MAAM,SAAS,WACzB,EAAU,MAAM,OAAO,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