{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/gB55riqALoa3EwNwInwb/xxEnf4AiHp3k4ObbYbQ1/HubspotOverride.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";/**\n * A helper function to read a cookie value by its name.\n * @param cookieName The key for the cookie we want to retrieve.\n * @returns The cookie value or an empty string if not found.\n */function getCookieValue(cookieName){const nameEQ=cookieName+\"=\";const cookies=document.cookie.split(\";\");for(let i=0;i<cookies.length;i++){let cookie=cookies[i].trim();if(cookie.indexOf(nameEQ)===0){return cookie.substring(nameEQ.length,cookie.length);}}return\"\";}/**\n * This function checks the URL parameters and cookies for specific fields,\n * gives priority to the URL value, and then sets the final value into\n * the corresponding hidden input in the HubSpot form.\n */function fillHubspotFields(){// 1. Read URL parameters\nconst urlParams=new URLSearchParams(window.location.search);// 2. Define the fields we are going to handle\nconst fields=[\"gclid\",\"fbclid\",\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"];// 3. For each field:\nfields.forEach(fieldName=>{// Try to get the value from the URL\nconst valueFromUrl=urlParams.get(fieldName)||\"\";// If URL is empty, then try cookies\nconst valueFromCookie=getCookieValue(fieldName)||\"\";// Final value prioritizes the URL parameter\nconst finalValue=valueFromUrl!==\"\"?valueFromUrl:valueFromCookie;// Query the input in the DOM (assuming it's not in an iFrame)\nconst input=document.querySelector(`input[name=\"${fieldName}\"]`);// If we found the field, set the value\nif(input&&finalValue){input.value=finalValue;// Trigger change event so HubSpot sees the updated value\ninput.dispatchEvent(new Event(\"change\",{bubbles:true}));}});}/**\n * Framer Override component\n */export function HubspotOverride(){useEffect(()=>{// Run once on mount \u2014 fill form fields when the component loads\nfillHubspotFields();},[]);// No visual properties to override, so return an empty object\nreturn{};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withHubspotOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...HubspotOverride(props)});};}withHubspotOverride.displayName=\"HubspotOverride\";\nexport const __FramerMetadata__ = {\"exports\":{\"HubspotOverride\":{\"type\":\"override\",\"name\":\"HubspotOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHubspotOverride\":{\"type\":\"reactHoc\",\"name\":\"withHubspotOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HubspotOverride.map"],
  "mappings": "wGAIG,SAASA,EAAeC,EAAW,CAAC,IAAMC,EAAOD,EAAW,IAAUE,EAAQ,SAAS,OAAO,MAAM,GAAG,EAAE,QAAQC,EAAE,EAAEA,EAAED,EAAQ,OAAOC,IAAI,CAAC,IAAIC,EAAOF,EAAQC,CAAC,EAAE,KAAK,EAAE,GAAGC,EAAO,QAAQH,CAAM,IAAI,EAAG,OAAOG,EAAO,UAAUH,EAAO,OAAOG,EAAO,MAAM,EAAI,MAAM,EAAG,CAIvQ,SAASC,GAAmB,CAC/B,IAAMC,EAAU,IAAI,gBAAgBC,EAAO,SAAS,MAAM,EAC7C,CAAC,QAAQ,SAAS,aAAa,aAAa,eAAe,WAAW,aAAa,EACzF,QAAQC,GAAW,CAC1B,IAAMC,EAAaH,EAAU,IAAIE,CAAS,GAAG,GACvCE,EAAgBX,EAAeS,CAAS,GAAG,GAC3CG,EAAWF,IAAe,GAAGA,EAAaC,EAC1CE,EAAM,SAAS,cAAc,eAAeJ,KAAa,EAC5DI,GAAOD,IAAYC,EAAM,MAAMD,EAClCC,EAAM,cAAc,IAAI,MAAM,SAAS,CAAC,QAAQ,EAAI,CAAC,CAAC,EAAG,CAAC,CAAE,CAElD,SAASC,GAAiB,CAAC,OAAAC,EAAU,IAAI,CACnDT,EAAkB,CAAE,EAAE,CAAC,CAAC,EAClB,CAAC,CAAE,CAA2J,SAASU,EAAoBC,EAAE,CAAC,OAAOC,IAAQC,EAA+BC,CAAuC,EAASC,EAAKJ,EAAE,CAAC,GAAGC,EAAM,GAAGJ,EAAgBI,CAAK,CAAC,CAAC,EAAI,CAACF,EAAoB,YAAY",
  "names": ["getCookieValue", "cookieName", "nameEQ", "cookies", "i", "cookie", "fillHubspotFields", "urlParams", "window", "fieldName", "valueFromUrl", "valueFromCookie", "finalValue", "input", "HubspotOverride", "ue", "withHubspotOverride", "C", "props", "re", "DataObserverContext", "p"]
}
