{"version":3,"file":"LinkUtils.CHQbgORa.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/u6A3fm3N29z0A2udGQ2n/NCzNDDR7iRAUFNnpVSqG/LinkUtils.js"],"sourcesContent":["// Ensure that the following code is located in both framer and in github's iron/framer/ when making any changes\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useState,useEffect}from\"react\";function getReplacedDomainUrl(currentDomain,link){if(currentDomain.includes(\"mixpanel.com\")||currentDomain.includes(\"mixpanel.org\")){const url=new URL(link);url.host=currentDomain;return url.toString();}return link;}// @ts-ignore\nexport function withLinkToCurrentMixpanelDomain(Component){// @ts-ignore\nreturn /*#__PURE__*/forwardRef((props,ref)=>{const[currentDomain,setCurrentDomain]=useState(``);useEffect(()=>{if(window.location.hostname){setCurrentDomain(window.location.hostname);}},[]);if(props.link){props.link=getReplacedDomainUrl(currentDomain,props.link);}return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}// @ts-ignore\nexport function buttonWithLinkToCurrentMixpanelDomain(Component){// @ts-ignore\nreturn /*#__PURE__*/forwardRef((props,ref)=>{const[currentDomain,setCurrentDomain]=useState(``);useEffect(()=>{if(window.location.hostname){setCurrentDomain(window.location.hostname);}},[]);if(props.buttonLink){props.buttonLink=getReplacedDomainUrl(currentDomain,props.buttonLink);}return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}// @ts-ignore\nexport function iconWithLinkToCurrentMixpanelDomain(Component){// @ts-ignore\nreturn /*#__PURE__*/forwardRef((props,ref)=>{const[currentDomain,setCurrentDomain]=useState(``);useEffect(()=>{if(window.location.hostname){setCurrentDomain(window.location.hostname);}},[]);if(props.href){props.href=getReplacedDomainUrl(currentDomain,props.href);}return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}// @ts-ignore\nexport function loginButton(Component){// @ts-ignore\nreturn /*#__PURE__*/forwardRef((props,ref)=>{const[currentDomain,setCurrentDomain]=useState(``);useEffect(()=>{if(window.location.hostname){setCurrentDomain(window.location.hostname);}},[]);if(props.link){props.link=getReplacedDomainUrl(currentDomain,props.link);}if(!props.className?.includes(`login-button`)){props.className+=\" login-button\";}return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withLinkToCurrentMixpanelDomain\":{\"type\":\"reactHoc\",\"name\":\"withLinkToCurrentMixpanelDomain\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"buttonWithLinkToCurrentMixpanelDomain\":{\"type\":\"reactHoc\",\"name\":\"buttonWithLinkToCurrentMixpanelDomain\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"loginButton\":{\"type\":\"reactHoc\",\"name\":\"loginButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"iconWithLinkToCurrentMixpanelDomain\":{\"type\":\"reactHoc\",\"name\":\"iconWithLinkToCurrentMixpanelDomain\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkUtils.map"],"mappings":"8IAC4F,SAAS,EAAqB,EAAc,EAAK,CAAC,GAAG,EAAc,SAAS,cAAc,GAAG,EAAc,SAAS,cAAc,EAAE,CAAC,IAAM,EAAI,IAAI,IAAI,CAAI,EAAyB,MAAvB,GAAI,KAAK,EAAqB,EAAI,SAAS,CAAE,CAAC,OAAO,CAAK,CAGnT,SAAgB,EAAsC,EAAU,CAChE,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAS,EAAE,EAA4L,OAA1L,MAAc,CAAI,EAAO,SAAS,UAAU,EAAiB,EAAO,SAAS,QAAQ,CAAG,EAAE,CAAC,CAAC,EAAE,AAAqB,EAAM,aAAW,EAAqB,EAAc,EAAM,UAAU,EAAuB,EAAK,EAAU,CAAK,MAAI,GAAG,CAAK,CAAC,CAAE,CAAC,CAAE,CACpV,SAAgB,EAAoC,EAAU,CAC9D,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,EAAc,GAA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