{"version":3,"file":"RedirectTo.BAT73SQ7.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/U5Zmbyf4BWoq5QttpiPL/mD7sUjlafHXf4uGirgeN/RedirectTo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useState,useEffect}from\"react\";const STAGING_ORIGIN=\"https://streaming.staging.sports.aparentmedia.com\";export function withCustomLink(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[url,setUrl]=useState(null);useEffect(()=>{if(!props.link)return;try{const originalUrl=new URL(props.link);const isStaging=window.location.hostname.includes(\"staging\");let finalUrl=originalUrl.toString();if(isStaging){// Build new URL: new origin + old path + query + hash\nfinalUrl=STAGING_ORIGIN+originalUrl.pathname+originalUrl.search+originalUrl.hash;}setUrl(finalUrl);}catch(err){console.error(\"Invalid URL:\",props.link);setUrl(props.link);}},[props.link]);if(!url)return null;return /*#__PURE__*/_jsx(Component,{...props,ref:ref,href:url,link:url,target:\"_blank\"});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withCustomLink\":{\"type\":\"reactHoc\",\"name\":\"withCustomLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RedirectTo.map"],"mappings":"yIAAqK,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAI,GAAQA,EAAS,KAAK,CAC5E,OAD6E,MAAc,CAAK,KAAM,KAAY,GAAG,CAAC,IAAM,EAAY,IAAI,IAAI,EAAM,KAAK,CAAO,EAAU,EAAO,SAAS,SAAS,SAAS,UAAU,CAAK,EAAS,EAAY,UAAU,CAAI,IAChd,EAAS,EAAe,EAAY,SAAS,EAAY,OAAO,EAAY,MAAM,EAAO,EAAS,MAAY,CAAC,QAAQ,MAAM,eAAe,EAAM,KAAK,CAAC,EAAO,EAAM,KAAK,GAAI,CAAC,EAAM,KAAK,CAAC,CAAK,EAAoC,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,KAAK,EAAI,KAAK,EAAI,OAAO,SAAS,CAAC,CAA7F,MAAgG,wBADhQ,IAAiD,CAAM,EAAe"}