{"version":3,"file":"Redirect_with_data.2cse4uuI.mjs","names":[],"sources":["https:/framerusercontent.com/modules/kE8XjSuZYjGUNEfdDvW8/FaD4TypgQrseCoeFxIzN/Redirect_with_data.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 100\n * @framerIntrinsicHeight 50\n */export function withRedirectWrapper(Component){return props=>{const handleClick=()=>{// Captura os dados do formulário\nconst email=document.querySelector('input[name=\"email\"]')?.value||\"\";const firstName=document.querySelector('input[name=\"firstname\"]')?.value||\"\";const lastName=document.querySelector('input[name=\"lastname\"]')?.value||\"\";const phone=document.querySelector('input[name=\"phone\"]')?.value||\"\";// Combina firstname e lastname em um único campo\nconst fullName=`${firstName} ${lastName}`.trim();// Captura os parâmetros UTM da URL atual\nconst currentUrl=new URL(window.location.href);const utmParams=new URLSearchParams(currentUrl.search);const utmString=Array.from(utmParams).filter(([key])=>key.startsWith(\"utm_\")).map(([key,value])=>`${key}=${encodeURIComponent(value)}`).join(\"&\");// Constrói a URL de redirecionamento com os dados do formulário e UTMs\nconst baseUrl=`https://go.mevbrasil.com.br/pay/mevglobal-standard?&email=${encodeURIComponent(email)}&name=${encodeURIComponent(fullName)}&phone=${encodeURIComponent(phone)}`;const redirectUrl=utmString?`${baseUrl}&${utmString}`:baseUrl;// Redireciona o usuário\nwindow.location.href=redirectUrl;};return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRedirectWrapper\":{\"type\":\"reactHoc\",\"name\":\"withRedirectWrapper\",\"annotations\":{\"framerIntrinsicHeight\":\"50\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 100\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirect_with_data.map"],"mappings":"kKAIG,SAAgB,EAAoB,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,IAAM,EAAY,IAAI,CACvF,IAAM,EAAM,SAAS,cAAc,sBAAsB,EAAE,OAAO,GAAS,EAAU,SAAS,cAAc,0BAA0B,EAAE,OAAO,GAAS,EAAS,SAAS,cAAc,yBAAyB,EAAE,OAAO,GAAS,EAAM,SAAS,cAAc,sBAAsB,EAAE,OAAO,GACzR,EAAS,GAAG,EAAU,GAAG,IAAW,MAAM,CAC1C,EAAW,IAAI,IAAI,EAAO,SAAS,MAAY,EAAU,IAAI,gBAAgB,EAAW,QAAc,EAAU,MAAM,KAAK,EAAU,CAAC,OAAO,CAAC,CAAC,EAAI,GAAG,EAAI,WAAW,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAI,EAAM,MAAM,EAAI,GAAG,mBAAmB,EAAM,GAAG,CAAC,KAAK,IAAI,CACjP,GAAS,4DAA4D,mBAAmB,EAAM,CAAC,QAAQ,mBAAmB,EAAS,CAAC,SAAS,mBAAmB,EAAM,GAAS,EAAY,KAAa,EAAQ,GAAG,IAAY,EACrO,EAAO,SAAS,KAAK,CAAa,EAAC,MAAoB,GAAK,MAAM,CAAC,QAAQ,EAAY,SAAsB,EAAK,EAAU,CAAC,GAAG,CAAM,EAAC,AAAC,EAAC,AAAE,CAAE,cAT7I,IAAA,GAA2C"}