{"version":3,"file":"HeaderButtons.DoVccbPp.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/a4oF5h7bCM6Dx0P96uUW/wxfrIwhAXMVhJ69Dzmuw/HeaderButtons.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{getCelloVariables}from\"https://framerusercontent.com/modules/bFRjjxRy4wivOXQq3YZk/J4CcIkQhDpbloGD2OpxI/CelloInviteHeader.js\";// Define getCookie function that checks if document is available\nfunction getCookie(name){if(typeof document===\"undefined\"){return null// Document is not available, return null\n;}const value=`; ${document.cookie}`;const parts=value.split(`; ${name}=`);if(parts.length===2)return parts.pop()?.split(\";\").shift()||null;return null;}// Custom hook to check the 'signed-in' cookie status\nfunction useCheckSignedInCookie(){const[isSignedIn,setIsSignedIn]=useState(false);useEffect(()=>{const signedInCookie=getCookie(\"signed-in\");setIsSignedIn(signedInCookie===\"true\");},[]);return isSignedIn;}// Function to determine the label based on the URL path\nfunction getTranslatedLabel(){const path=typeof window!==\"undefined\"?window.location.pathname:\"\";if(path.includes(\"/nl/\")){return\"Ga naar de app\"// Dutch translation\n;}else if(path.includes(\"/fr/\")){return\"Aller \\xe0 l'app\"// French translation\n;}else{return\"Go to app\"// Default English text\n;}}export function withText(Component){return props=>{const[ucc,setUcc]=useState(null);const isSignedIn=useCheckSignedInCookie();const celloVariables=getCelloVariables();const additionalProps=isSignedIn?{label:getTranslatedLabel(),link:\"https://app.bizzy.org\"}:{link:ucc?\"/referral\":\"/request-a-demo\"};useEffect(()=>{if(celloVariables.ucc)setUcc(celloVariables.ucc);},[celloVariables.ucc]);return /*#__PURE__*/_jsx(Component,{...props,...additionalProps});};}export function hideOnLogin(Component){return props=>{const isSignedIn=useCheckSignedInCookie();if(isSignedIn){return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,display:\"none\"}});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withText\":{\"type\":\"reactHoc\",\"name\":\"withText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"hideOnLogin\":{\"type\":\"reactHoc\",\"name\":\"hideOnLogin\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeaderButtons.map"],"mappings":"wLACA,SAAS,EAAU,EAAK,CAAC,GAAG,OAAO,SAAW,IAAa,OAAO,KAC7B,IAAM,EAA7B,KAAK,SAAS,SAA2B,MAAM,KAAK,EAAK,GAAG,CAAkE,OAA9D,EAAM,SAAS,GAAS,EAAM,KAAK,EAAE,MAAM,IAAI,CAAC,OAAO,EAAc,KACnJ,SAAS,GAAwB,CAAC,GAAK,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAyG,OAAxG,MAAc,CAA6C,EAAvB,EAAU,YAAY,GAAgC,OAAO,EAAG,EAAE,CAAC,CAAQ,EACjM,SAAS,GAAoB,CAAC,IAAM,EAAY,IAAS,OAAqC,GAAzB,EAAO,SAAS,SAE9E,OAF6F,EAAK,SAAS,OAAO,CAAQ,iBACvH,EAAK,SAAS,OAAO,CAAQ,gBAC1B,YACV,SAAgB,EAAS,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAI,GAAQA,EAAS,KAAK,CAAO,EAAW,GAAwB,CAAO,EAAe,GAAmB,CAAO,EAAgB,EAAW,CAAC,MAAM,GAAoB,CAAC,KAAK,wBAAwB,CAAC,CAAC,KAAK,EAAI,YAAY,kBAAkB,CAAyF,OAAxF,MAAc,CAAI,EAAe,KAAI,EAAO,EAAe,IAAI,EAAG,CAAC,EAAe,IAAI,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,GAAG,EAAgB,CAAC,EAAI,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAyB,GAAwB,CAAoC,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,QAAQ,OAAO,CAAC,CAAC,CAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,sBAPnpB,IAAsC,IAAoI"}