{"version":3,"file":"WithQueryParams.PzROHzMb.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","_e","c","init_jsx_runtime","init_npm_react_18_3_1","window","ce","withQueryParams","computedLink","setComputedLink","props","currentQuery","url","key","value","error","Component","init_WithQueryParams"],"sources":["https:/framerusercontent.com/modules/prAOHHvzcLUsUIfZ4Bk9/HAtO8MgkbbB2blO01t03/WithQueryParams.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function withQueryParams(Component){return props=>{const[computedLink,setComputedLink]=useState(props.link);useEffect(()=>{const currentQuery=window.location.search;console.log(currentQuery);// Only do the work if we have an original href and there is a query string\nif(props.link&&currentQuery){try{// Create a URL object from the original href\nconst url=new URL(props.link);// Append each query parameter from the current URL\nconst currentParams=new URLSearchParams(currentQuery);currentParams.forEach((value,key)=>{// Adjust logic if you want to avoid duplicates\nurl.searchParams.append(key,value);});// Update state with the new URL\nsetComputedLink(url.toString());}catch(error){console.error(\"Invalid URL provided to the button:\",error);}}},[props.link]);// Pass the computed href back to the Button (or default to original)\nreturn /*#__PURE__*/_jsx(Component,{...props,link:computedLink??props.link});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withQueryParams\":{\"type\":\"reactHoc\",\"name\":\"withQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithQueryParams.map"],"mappings":"A,uIAAiF,SAAgBS,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAACC,EAAaC,GAAiBX,EAASY,EAAM,IAAI,EAMlM,OANoMJ,MAAc,CAAC,IAAMK,EAAaN,EAAO,SAAS,OACtP,GAD6P,QAAQ,IAAIM,CAAY,EAClRD,EAAM,MAAMC,EAAc,GAAG,CAChC,IAAMC,EAAI,IAAI,IAAIF,EAAM,IAAI,EAC0B,IAA9B,gBAAgBC,CAA0B,CAAC,CAAC,SAAS,EAAM,IAAM,CACzFC,EAAI,aAAa,OAAOC,EAAIC,CAAK,CAAE,CAAC,EACpCL,EAAgBG,EAAI,SAAS,CAAC,CAAE,OAAOG,EAAM,CAAC,QAAQ,MAAM,sCAAsCA,CAAK,CAAE,CAAE,EAAE,CAACL,EAAM,IAAI,CAAC,EACrG,gBAAKM,EAAU,CAAC,GAAGN,EAAM,KAAKF,GAAcE,EAAM,IAAI,CAAC,CAAE,CAAE,C"}