{"version":3,"file":"IdentifyWithPosthog.BEdN-cbH.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/NUP4OU3pgvuhbnLdw962/gE5y4Zlcnt06uD5yPDsg/IdentifyWithPosthog.js"],"sourcesContent":["// Identify the user via the email in the form\n// Capture the UTM/other params\nimport{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect}from\"react\";export default function IdentifyWithPosthog(){useEffect(()=>{const findFormWithRetry=()=>{const form=document.querySelector(\"form\");if(form){const params=new URLSearchParams(window.location.search);form.addEventListener(\"submit\",e=>{e.preventDefault();const emailInput=form.querySelector('input[type=\"email\"]');const email=emailInput?.value||\"\";if(window.posthog){window.posthog.identify(email,{email});window.posthog.capture(\"trial_form_submitted\",{...params});}});}else{setTimeout(findFormWithRetry,100);}};findFormWithRetry();},[]);return /*#__PURE__*/_jsx(_Fragment,{});}// export default function IdentifyWithPosthog() {\n//     useEffect(() => {\n//         const form = document.querySelector(\"form\")\n//         const params = new URLSearchParams(window.location.search)\n//         form.addEventListener(\"submit\", (e) => {\n//             e.preventDefault()\n//             const emailInput = form.querySelector<HTMLInputElement>(\n//                 'input[type=\"email\"]'\n//             )\n//             const email = emailInput?.value || \"\"\n//             if (window.posthog) {\n//                 console.log(\"capturing\")\n//                 window.posthog.identify(email)\n//                 window.posthog.capture(\"trial_form_submitted\", {\n//                     ...params,\n//                 })\n//             }\n//         })\n//     }, [])\n//     return <></>\n// }\n\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IdentifyWithPosthog\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IdentifyWithPosthog.map"],"mappings":"uIAE8F,SAAwB,GAAqB,CAA0e,OAAze,MAAc,CAAC,IAAM,MAAsB,CAAC,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,GAAG,EAAK,CAAC,IAAM,EAAO,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,EAAK,iBAAiB,SAAS,GAAG,CAAC,EAAE,gBAAgB,CAA4D,IAAM,EAAhD,EAAK,cAAc,sBAAsB,EAAyB,OAAO,GAAM,EAAO,UAAS,EAAO,QAAQ,SAAS,EAAM,CAAC,QAAM,CAAC,CAAC,EAAO,QAAQ,QAAQ,uBAAuB,CAAC,GAAG,EAAO,CAAC,GAAI,MAAO,WAAW,EAAkB,IAAI,EAAI,GAAmB,EAAG,EAAE,CAAC,CAAqB,EAAKA,EAAU,EAAE,CAAC,sBAA1lB,IAA6B"}