{"version":3,"file":"WithNewUTM.B5LthZAV.mjs","names":["React.useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/7feQA7CUMDP3FhCVlekm/zSFBORadE43PTI2Hr3Bi/WithNewUTM.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";// This override component will pass UTM parameters to the JotForm iframe\nexport function withUTMParams(){return{// Run when the component mounts\nonMount(props){updateJotFormWithUTM();// Set up a MutationObserver to watch for when the iframe gets added to the DOM\n// This helps in cases where the iframe loads after our code runs\nconst observer=new MutationObserver((mutations,obs)=>{const iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');if(iframe){updateJotFormWithUTM();obs.disconnect()// Stop observing once we've found and updated the iframe\n;console.log(\"JotForm iframe found and updated via MutationObserver\");}});// Start observing the document with the configured parameters\nobserver.observe(document.body,{childList:true,subtree:true});// Also try updating after a delay to catch slow-loading iframes\nsetTimeout(()=>{updateJotFormWithUTM();},1e3);},// Run when props change or component updates\nonUpdate(){updateJotFormWithUTM();}};}// Function to handle updating the JotForm iframe with UTM parameters\nfunction updateJotFormWithUTM(){// Find the JotForm iframe - use a more specific selector based on your provided code\nconst iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');if(!iframe||!iframe.src){console.log(\"JotForm iframe not found or has no src attribute yet\");return;}try{// Parse current iframe URL\nconst url=new URL(iframe.src);// Get UTM parameters from the page URL\nconst pageParams=new URLSearchParams(window.location.search);// List of UTM parameters to transfer\nconst utmParams=[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"];// Transfer UTM parameters\nlet paramsAdded=false;for(const param of utmParams){const value=pageParams.get(param);if(value){url.searchParams.set(param,value);paramsAdded=true;}}// Only update if we actually added parameters\nif(paramsAdded){console.log(\"Updating JotForm iframe with UTM parameters:\",url.toString());iframe.src=url.toString();// Track the update with Zuko if it's available\nif(window.Zuko&&typeof window.Zuko.trackEvent===\"function\"){try{window.Zuko.trackEvent(\"utm_parameters_added\");}catch(e){console.log(\"Zuko tracking available but failed:\",e);}}}else{console.log(\"No UTM parameters found in the URL\");}}catch(error){console.error(\"Error updating JotForm with UTM parameters:\",error);}}// Add a second component for easier debugging if needed\nexport function UTMDebugger(){const[debug,setDebug]=React.useState({url:\"\",utmParams:{},iframeFound:false});React.useEffect(()=>{// Get current URL and UTM parameters\nconst currentUrl=window.location.href;const params=new URLSearchParams(window.location.search);const utmParams={};[\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_term\",\"utm_content\"].forEach(param=>{const value=params.get(param);if(value)utmParams[param]=value;});// Check if iframe exists\nconst iframe=document.querySelector('iframe[src*=\"form.jotform.com/251057440067149\"]');setDebug({url:currentUrl,utmParams,iframeFound:!!iframe});},[]);return{// This adds a small debug overlay to the component\n// You can attach this to any element to see debugging info\nonTap(){console.log(\"Debug Info:\",debug);alert(`UTM Debug:\nURL: ${debug.url}\nUTM Params: ${JSON.stringify(debug.utmParams,null,2)}\nJotForm iframe found: ${debug.iframeFound}\n            `);}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withwithUTMParams(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...withUTMParams(props)});};}withwithUTMParams.displayName=\"withUTMParams\";export function withUTMDebugger(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...UTMDebugger(props)});};}withUTMDebugger.displayName=\"UTMDebugger\";\nexport const __FramerMetadata__ = {\"exports\":{\"withUTMParams\":{\"type\":\"override\",\"name\":\"withUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"UTMDebugger\":{\"type\":\"override\",\"name\":\"UTMDebugger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withwithUTMParams\":{\"type\":\"reactHoc\",\"name\":\"withwithUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUTMDebugger\":{\"type\":\"reactHoc\",\"name\":\"withUTMDebugger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithNewUTM.map"],"mappings":"+LACA,SAAgB,GAAe,CAAC,MAAM,CACtC,QAAQ,EAAM,CAAC,GAAsB,CAEtB,IAAI,kBAAkB,EAAU,IAAM,CAAc,SAAS,cAAc,kDAAkD,GAAY,GAAsB,CAAC,EAAI,YAAY,CAC9L,QAAQ,IAAI,wDAAwD,GAAI,CAChE,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,GAAK,CAAC,CAC7D,eAAe,CAAC,GAAsB,EAAG,IAAI,EAC7C,UAAU,CAAC,GAAsB,EAAG,CACpC,SAAS,GAAsB,CAC/B,IAAM,EAAO,SAAS,cAAc,kDAAkD,CAAC,GAAG,CAAC,GAAQ,CAAC,EAAO,IAAI,CAAC,QAAQ,IAAI,uDAAuD,CAAC,OAAQ,GAAG,CAC/L,IAAM,EAAI,IAAI,IAAI,EAAO,IAAI,CACvB,EAAW,IAAI,gBAAgB,EAAO,SAAS,OAAO,CACtD,EAAU,CAAC,aAAa,aAAa,eAAe,WAAW,cAAc,CAC/E,EAAY,GAAM,IAAI,IAAM,KAAS,EAAU,CAAC,IAAM,EAAM,EAAW,IAAI,EAAM,CAAI,IAAO,EAAI,aAAa,IAAI,EAAM,EAAM,CAAC,EAAY,IAC9I,GAAG,EACH,IADgB,QAAQ,IAAI,+CAA+C,EAAI,UAAU,CAAC,CAAC,EAAO,IAAI,EAAI,UAAU,CACjH,EAAO,MAAM,OAAO,EAAO,KAAK,YAAa,WAAY,GAAG,CAAC,EAAO,KAAK,WAAW,uBAAuB,OAAQ,EAAE,CAAC,QAAQ,IAAI,sCAAsC,EAAE,OAAS,QAAQ,IAAI,qCAAqC,OAAS,EAAM,CAAC,QAAQ,MAAM,8CAA8C,EAAM,EACzT,SAAgB,G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