{"version":3,"file":"FormPrefill.kag2L0Tr.mjs","names":["forwardRef","useRef","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","window","c","J","init_jsx_runtime","ce","init_npm_react_18_3_1","de","apply","root","key","value","MAP","select","withInterestFromLink","Component","props","ref","local","onHash","el","init_FormPrefill","\"partnership\""],"sources":["https:/framerusercontent.com/modules/HbmuFlJL2zeGU85wFd99/mdzaRiy4p4gSqmhqwJio/FormPrefill.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";const MAP={\"one-off\":\"A one-off case study\",\"partnership\":\"A partnership\"};function apply(root){if(typeof window===\"undefined\"||!root)return;const key=window.location.hash.replace(\"#\",\"\");const value=MAP[key];if(!value)return;const select=root.tagName===\"SELECT\"?root:root.querySelector(\"select\");if(!select)return;select.value=value;select.dispatchEvent(new Event(\"change\",{bubbles:true}));}/** Pre-selects the enquiry type when someone arrives via #one-off or #partnership. */export function withInterestFromLink(Component){return /*#__PURE__*/forwardRef(function InterestFromLink(props,ref){const local=useRef(null);useEffect(()=>{apply(local.current);const onHash=()=>setTimeout(()=>apply(local.current),50);window.addEventListener(\"hashchange\",onHash);return()=>window.removeEventListener(\"hashchange\",onHash);},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:el=>{local.current=el;if(typeof ref===\"function\")ref(el);else if(ref)ref.current=el;}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withInterestFromLink\":{\"type\":\"reactHoc\",\"name\":\"withInterestFromLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormPrefill.map"],"mappings":"A,8IAAqK,SAASa,EAAMC,EAAK,CAAC,GAAUR,IAAS,QAAa,CAACQ,EAAK,OAAO,IAAMC,EAAIT,EAAO,SAAS,KAAK,QAAQ,IAAI,EAAE,EAAQU,EAAMC,EAAIF,GAAK,GAAG,CAACC,EAAM,OAAO,IAAME,EAAOJ,EAAK,UAAU,SAASA,EAAKA,EAAK,cAAc,QAAQ,EAAMI,IAAcA,EAAO,MAAMF,EAAME,EAAO,cAAc,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAI,CAAC,CAAC,EAAE,CAAuF,SAAgBC,EAAqBC,EAAU,CAAC,MAAoBpB,gBAAW,SAA0BqB,EAAMC,EAAI,CAAC,IAAMC,EAAMtB,EAAO,IAAI,EAA4M,OAA1MC,MAAc,CAACW,EAAMU,EAAM,OAAO,EAAE,IAAMC,MAAW,eAAeX,EAAMU,EAAM,OAAO,EAAE,EAAE,EAA+C,OAA7CjB,EAAO,iBAAiB,aAAakB,CAAM,MAAYlB,EAAO,oBAAoB,aAAakB,CAAM,CAAE,EAAE,CAAC,CAAC,EAAsBrB,gBAAKiB,EAAU,CAAC,GAAGC,EAAM,IAAII,GAAI,CAACF,EAAM,QAAQE,EAAM,OAAOH,GAAM,WAAWA,EAAIG,CAAE,EAAUH,IAAIA,EAAI,QAAQG,EAAG,CAAC,CAAC,CAAE,CAAC,CAAE,C,gDAA37BR,EAAI,CAAC,UAAU,uBAAuBU,YAAc,eAAe,C"}