{"version":3,"file":"SearchParamsPersist.CKxF_avC.mjs","names":["__legacyOverrideHOC_DataObserverContext"],"sources":["https:/framerusercontent.com/modules/4PINjqo48OHC6rcgYhOj/3FGqXF5fYrSoQLN4QIUP/SearchParamsPersist.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";export function RedirectCTA(){return{onTap:()=>{// Get all current search parameters\nconst search=new URLSearchParams(window.location.search);const pathname=window.location.pathname;// Check if it is coming from tutorial page\nconst tutorials=pathname.includes(\"tutorials\");const customerStories=pathname.includes(\"customer-stories\");const blog=pathname.includes(\"blog\");const heygen=pathname.includes(\"heygen\");const utm_source=search.get(\"utm_source\");if(!utm_source){if(tutorials){const slug=pathname.split(\"/\").pop();search.set(\"utm_source\",\"website\");search.set(\"utm_medium\",\"tutorials\");search.set(\"utm_campaign\",slug);}else if(customerStories){const slug=pathname.split(\"/\").pop();search.set(\"utm_source\",\"website\");search.set(\"utm_medium\",\"customer_stories\");search.set(\"utm_campaign\",slug);}else if(blog){const slug=pathname.split(\"/\").pop();search.set(\"utm_source\",\"website\");search.set(\"utm_medium\",\"blog\");search.set(\"utm_campaign\",slug);}else if(heygen){const slug=pathname.split(\"/\").pop();search.set(\"utm_source\",\"website\");search.set(\"utm_medium\",\"heygen\");search.set(\"utm_campaign\",slug);}}const searchParams=search.toString();// Redirect to the new URL with all search params\nwindow.location.href=`https://app.trupeer.ai/?${searchParams}`;}};}// export function RedirectCTA(): Override {\n//     return {\n//         onTap: () => {\n//             // ✅ Ensure this only runs in the browser\n//             if (\n//                 typeof window === \"undefined\" ||\n//                 typeof document === \"undefined\"\n//             ) {\n//                 console.warn(\n//                     \"RedirectCTA tried to run on the server. Exiting...\"\n//                 )\n//                 return\n//             }\n//             // ✅ Get all current search parameters safely\n//             const searchParams = new URLSearchParams(window.location.search)\n//             // ✅ Get the cookie with key \"_fprom_tid\" safely\n//             const cookies = document.cookie ? document.cookie.split(\"; \") : []\n//             const fpromCookie = cookies.find((row) =>\n//                 row.startsWith(\"_fprom_tid=\")\n//             )\n//             // ✅ If the cookie exists, append it to search params\n//             if (fpromCookie) {\n//                 const fpromValue = fpromCookie.split(\"=\")[1]\n//                 searchParams.set(\"_fprom_tid\", fpromValue)\n//             }\n//             // ✅ Redirect to the new URL with updated search params\n//             window.location.href = `https://app.trupeer.ai?${searchParams.toString()}`\n//         },\n//     }\n// }\nimport{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withRedirectCTA(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...RedirectCTA(props)});};}withRedirectCTA.displayName=\"RedirectCTA\";\nexport const __FramerMetadata__ = {\"exports\":{\"RedirectCTA\":{\"type\":\"override\",\"name\":\"RedirectCTA\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRedirectCTA\":{\"type\":\"reactHoc\",\"name\":\"withRedirectCTA\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SearchParamsPersist.map"],"mappings":"yRAA2C,SAAgB,GAAa,CAAC,MAAM,CAAC,MAAM,IAAI,CAC1F,IAAM,EAAO,IAAI,gBAAgB,EAAO,SAAS,QAAc,EAAS,EAAO,SAAS,SAClF,EAAU,EAAS,SAAS,YAAY,CAAO,EAAgB,EAAS,SAAS,mBAAmB,CAAO,EAAK,EAAS,SAAS,OAAO,CAAO,EAAO,EAAS,SAAS,SAAS,CAAO,EAAW,EAAO,IAAI,aAAa,CAAC,IAAI,MAAe,EAAU,CAAC,IAAM,EAAK,EAAS,MAAM,IAAI,CAAC,KAAK,CAAyE,AAAxE,EAAO,IAAI,aAAa,UAAU,CAAC,EAAO,IAAI,aAAa,YAAY,CAAC,EAAO,IAAI,eAAe,EAAK,AAAE,SAAQ,EAAgB,CAAC,IAAM,EAAK,EAAS,MAAM,IAAI,CAAC,KAAK,CAAgF,AAA/E,E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