{"version":3,"file":"CookieBanner.C_LMZp2D.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/KmHIfa2C5h9hKvpDFQnA/dUd2iXs8TuAyPReHc2uU/CookieBanner.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createPortal}from\"react-dom\";import{useLocaleInfo}from\"framer\";/**\n * Trackbase — cookie consent banner\n *\n * Framer's native banner lives in Site Settings, which is not reachable over\n * the API, so this replaces it. The component renders its own fixed overlay,\n * independent of where the instance sits in the layout (portalled onto\n * document.body so no transformed ancestor can trap or cover it), and stores\n * the choice\n * in localStorage. It speaks Google Consent Mode: it pushes the visitor's\n * choice onto the dataLayer, so once the GTM container (GTM-P4PDBVS3) is\n * installed, tags fire only after consent. Until a choice is made, nothing is\n * granted.\n *\n * Reopen later via window.tbOpenCookieSettings() (for a \"Cookie settings\"\n * footer link).\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */const BLUE=\"#1866E1\";const NAVY=\"#101828\";const GREY=\"#667085\";const LINE=\"#E5E7EB\";const FONT='\"Poppins\", \"Inter\", -apple-system, sans-serif';const KEY=\"tb-cookie-consent-v1\";const COPY={en:{title:\"We value your privacy\",body:\"We use cookies to understand how our site is used and to improve it. Necessary cookies are always on; analytics and marketing cookies only run with your consent.\",link:\"Cookie policy\",accept:\"Accept all\",reject:\"Necessary only\"},nl:{title:\"Jouw privacy telt\",body:\"We gebruiken cookies om te zien hoe onze site wordt gebruikt en om die te verbeteren. Noodzakelijke cookies staan altijd aan; analytics- en marketingcookies draaien alleen met jouw toestemming.\",link:\"Cookiebeleid\",accept:\"Alles accepteren\",reject:\"Alleen noodzakelijk\"}};function pushConsent(granted){try{const w=window;w.dataLayer=w.dataLayer||[];const state=granted?\"granted\":\"denied\";// gtag must push the Arguments object, not an array.\nfunction gtag(){w.dataLayer.push(arguments);}gtag(\"consent\",\"update\",{ad_storage:state,ad_user_data:state,ad_personalization:state,analytics_storage:state});w.dataLayer.push({event:\"tb_consent\",tb_consent_granted:granted});}catch(e){// Consent storage still succeeded; tags simply stay off.\n}}export default function CookieBanner(props){const[visible,setVisible]=useState(false);const[mounted,setMounted]=useState(false);let slug=\"\";try{const info=useLocaleInfo();slug=info&&info.activeLocale&&info.activeLocale.slug||\"\";}catch(e){// Canvas preview.\n}const t=slug===\"nl\"?COPY.nl:COPY.en;const policyHref=(slug?\"/\"+slug:\"\")+\"/legal/cookie-policy\";useEffect(()=>{setMounted(true);try{const stored=window.localStorage.getItem(KEY);if(stored){const parsed=JSON.parse(stored);// Re-announce the earlier choice on every page load, so GTM\n// picks it up before any tag fires.\npushConsent(!!parsed.granted);}else{setVisible(true);}window.tbOpenCookieSettings=function(){setVisible(true);};}catch(e){setVisible(true);}},[]);const choose=granted=>{try{window.localStorage.setItem(KEY,JSON.stringify({granted:granted,ts:Date.now()}));}catch(e){// Private mode: the banner will simply return next visit.\n}pushConsent(granted);setVisible(false);};if(!visible)return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,display:\"none\"}});const card=/*#__PURE__*/_jsxs(\"div\",{role:\"dialog\",\"aria-label\":t.title,style:{position:\"fixed\",right:16,bottom:16,left:\"auto\",zIndex:2147483e3,width:\"min(420px, calc(100vw - 32px))\",background:\"linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.25) 100%)\",backdropFilter:\"blur(12px) saturate(1.6)\",WebkitBackdropFilter:\"blur(12px) saturate(1.6)\",border:\"1px solid rgba(255, 255, 255, 0.75)\",borderRadius:16,boxShadow:\"0 12px 40px rgba(16, 24, 40, 0.18)\",padding:\"20px 20px 16px 20px\",fontFamily:FONT,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:15,fontWeight:600,letterSpacing:\"-0.01em\",color:NAVY,marginBottom:6},children:t.title}),/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:13,fontWeight:500,lineHeight:1.5,color:GREY,marginBottom:14},children:[t.body,\" \",/*#__PURE__*/_jsx(\"a\",{href:policyHref,style:{color:BLUE,textDecoration:\"none\",fontWeight:600},children:t.link})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",gap:10,justifyContent:\"flex-end\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>choose(false),style:{appearance:\"none\",cursor:\"pointer\",padding:\"9px 16px\",borderRadius:10,border:\"1px solid rgba(16, 24, 40, 0.14)\",background:\"rgba(255, 255, 255, 0.45)\",fontFamily:FONT,fontSize:13,fontWeight:600,color:NAVY},children:t.reject}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>choose(true),style:{appearance:\"none\",cursor:\"pointer\",padding:\"9px 16px\",borderRadius:10,border:\"1px solid \"+BLUE,background:BLUE,fontFamily:FONT,fontSize:13,fontWeight:600,color:\"#FFFFFF\"},children:t.accept})]})]});// Portal onto <body>: Framer sections use transforms for appear effects,\n// and a transformed ancestor both traps position:fixed and caps z-index.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{...props.style,width:0,height:0},children:mounted&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(card,document.body):card});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CookieBanner\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CookieBanner.map"],"mappings":"+MAkBgwB,SAAS,EAAY,EAAQ,CAAC,GAAG,CAAC,IAAM,EAAE,EAAO,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,IAAM,EAAM,EAAQ,UAAU,SAC32B,SAAS,GAAM,CAAC,EAAE,UAAU,KAAK,SAAS,CAAE,CAAC,EAAK,UAAU,SAAS,CAAC,WAAW,EAAM,aAAa,EAAM,mBAAmB,EAAM,kBAAkB,CAAK,CAAC,EAAE,EAAE,UAAU,KAAK,C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