{"version":3,"file":"WithForwardedParams.B2bwO2Aj.mjs","names":[],"sources":["https:/framerusercontent.com/modules/zOBwvYsftKzUws0axENG/8fIjYz65sA1drqHsrNlM/WithForwardedParams.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";export function withQueryParams(Component){return props=>{const handleClick=e=>{e.preventDefault();let finalLink=props.link||\"\";const queryParams=window.location.search.replace(\"?\",\"\");if(finalLink&&queryParams.length>0){finalLink+=finalLink.includes(\"?\")?`&${queryParams}`:`?${queryParams}`;}window.location.href=finalLink;};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}export function withWhatsAppForwardedParams(Component){return props=>{const handleClick=e=>{// e.preventDefault()\n// Build WhatsApp message using URL params\nconst params=new URLSearchParams(window.location.search);const phone=params.get(\"msg\");// if (!phone || isNaN(Number(phone))) {\n//     alert(\"Invalid or missing phone number.\")\n//     return\n// }\nconst msg=`Good news: Game Theory is now near you at Bellandur! 🏊\nI've been loving the swimming sessions - the new indoor temperature controlled pool is amazing!\n📍 Location: https://maps.app.goo.gl/xPWJSRXSF23sB5Ap9\nTry a FREE swimming class with my referral link:\n🔗 https://tinyurl.com/refer-GameTheory?utm_term=${phone}`;const encoded=encodeURIComponent(msg);const waLink=`https://api.whatsapp.com/send?text=${encoded}`;// OPTIONAL: Append existing query params from current URL (if desired)\nconst queryParams=window.location.search.replace(\"?\",\"\");let finalLink=waLink;if(queryParams.length>0){finalLink+=waLink.includes(\"?\")?`&${queryParams}`:`?${queryParams}`;}// console.log(finalLink)\nwindow.location.href=finalLink;};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}export function withUtmSourceParam(Component){return props=>{const handleClick=e=>{e.preventDefault();let finalLink=props.link||\"\";if(!finalLink)return;// Parse the link (relative/absolute safety)\ntry{const linkUrl=new URL(finalLink,window.location.origin);const params=new URLSearchParams(linkUrl.search);if(!params.has(\"utm_source\")){// Only add if absent\nparams.append(\"utm_source\",\"gametheory.in\")// set your value here\n;linkUrl.search=params.toString();finalLink=linkUrl.toString();}}catch(err){// fallback, do nothing\n}window.location.href=finalLink;};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withUtmSourceParam\":{\"type\":\"reactHoc\",\"name\":\"withUtmSourceParam\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWhatsAppForwardedParams\":{\"type\":\"reactHoc\",\"name\":\"withWhatsAppForwardedParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withQueryParams\":{\"type\":\"reactHoc\",\"name\":\"withQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithForwardedParams.map"],"mappings":"kHAA2C,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAY,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAI,EAAU,EAAM,MAAM,GAAS,EAAY,EAAO,SAAS,OAAO,QAAQ,IAAI,GAAG,CAAI,GAAW,EAAY,OAAO,IAAG,GAAW,EAAU,SAAS,IAAI,CAAC,IAAI,IAAc,IAAI,KAAe,EAAO,SAAS,KAAK,GAAY,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,CAAC,EAY5U,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAY,GAAG,CAAC,EAAE,gBAAgB,CAAC,IAAI,EAAU,EAAM,MAAM,GAAO,KAC9O,IAAG,CAAC,IAAM,EAAQ,IAAI,IAAI,EAAU,EAAO,SAAS,OAAO,CAAO,EAAO,IAAI,gBAAgB,EAAQ,OAAO,CAAK,EAAO,IAAI,aAAa,GACzI,EAAO,OAAO,aAAa,gBAAgB,CAC1C,EAAQ,OAAO,EAAO,UAAU,CAAC,EAAU,EAAQ,UAAU,OAAa,EAC1E,EAAO,SAAS,KAAK,IAAY,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,CAAC,uBAhBzD"}