{"version":3,"file":"FormUTM.B0bIn6Rm.mjs","names":[],"sources":["https:/framerusercontent.com/modules/4vyzvSLprL8YMdJq4yhd/N79UyAFhptVNM4HqsPxw/FormUTM.js"],"sourcesContent":["// Code Override for UTM Parameter Tracking\nimport{jsx as _jsx}from\"react/jsx-runtime\";export function handleUTMParameters(Component){return props=>{// Create refs to access the form element\nconst formRef=React.useRef(null);React.useEffect(()=>{// Parse UTM parameters from URL\nconst urlParams=new URLSearchParams(window.location.search);const utmSource=urlParams.get(\"utm_source\")||\"\";const utmMedium=urlParams.get(\"utm_medium\")||\"\";const utmCampaign=urlParams.get(\"utm_campaign\")||\"\";const utmTerm=urlParams.get(\"utm_term\")||\"\";const utmContent=urlParams.get(\"utm_content\")||\"\";// If we have a form element, add hidden inputs for UTM parameters\nconst formElement=formRef.current;if(formElement){// Create and append hidden fields for each UTM parameter\nconst utmFields=[{name:\"utm_source\",value:utmSource},{name:\"utm_medium\",value:utmMedium},{name:\"utm_campaign\",value:utmCampaign},{name:\"utm_term\",value:utmTerm},{name:\"utm_content\",value:utmContent}];utmFields.forEach(field=>{// Check if field already exists\nlet input=formElement.querySelector(`input[name=\"${field.name}\"]`);if(!input){// Create hidden input if it doesn't exist\ninput=document.createElement(\"input\");input.type=\"hidden\";input.name=field.name;formElement.appendChild(input);}// Set or update the value\ninput.value=field.value;});}},[]);// Return the component with the ref attached to the form\nreturn /*#__PURE__*/_jsx(Component,{...props,ref:formRef});};}\nexport const __FramerMetadata__ = {\"exports\":{\"handleUTMParameters\":{\"type\":\"reactComponent\",\"name\":\"handleUTMParameters\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormUTM.map"],"mappings":"kHAC2C,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CACxG,IAAM,EAAQ,MAAM,OAAO,KAAK,CAOhC,OAPiC,MAAM,cAAc,CACrD,IAAM,EAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAO,EAAU,EAAU,IAAI,aAAa,EAAE,GAAS,EAAU,EAAU,IAAI,aAAa,EAAE,GAAS,EAAY,EAAU,IAAI,eAAe,EAAE,GAAS,EAAQ,EAAU,IAAI,WAAW,EAAE,GAAS,EAAW,EAAU,IAAI,cAAc,EAAE,GACrS,EAAY,EAAQ,QAAW,GACrB,CAAC,CAAC,KAAK,aAAa,MAAM,EAAU,CAAC,CAAC,KAAK,aAAa,MAAM,EAAU,CAAC,CAAC,KAAK,eAAe,MAAM,EAAY,CAAC,CAAC,KAAK,WAAW,MAAM,EAAQ,CAAC,CAAC,KAAK,cAAc,MAAM,EAAW,CAAC,CAAW,QAAQ,GAAO,CACjO,IAAI,EAAM,EAAY,cAAc,eAAe,EAAM,KAAK,IAAI,CAAK,IACvE,EAAM,SAAS,cAAc,QAAQ,CAAC,EAAM,KAAK,SAAS,EAAM,KAAK,EAAM,KAAK,EAAY,YAAY,EAAM,EAC9G,EAAM,MAAM,EAAM,OAAQ,EAAI,EAAE,CAAC,CACb,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,EAAQ,CAAC,uBARf"}