{"version":3,"file":"Navigation.FoZXtMEE.mjs","names":["useState","useCallback","useRef"],"sources":["https:/framerusercontent.com/modules/MnjZUP24m4UFEVAo4MPz/F8apgu93f354JdSN1vAk/goToMarket.js","https:/framerusercontent.com/modules/WsLN4XQfJdeqkYSXsIEd/EWqKEkQzSxcpIdCqagW0/Navigation.js"],"sourcesContent":["// !!!\n// THIS FILE IS FOR MANAGING GOOLGE TAG MANAGER.\n// IT IS CALLED goToMarket.tsx BECAUSE GTM.tsx WILL BE BLOCKED BY AD BLOCKERS.\n// !!!\nexport const goToMarket={enableCookies(){if(!window.dataLayer)return;window.dataLayer.push({event:\"cookieConsentAllow\",cookieConsent:\"allow\"});},trackEvent(data,cb){if(!data.category||!data.action||!window.dataLayer){return;}window.dataLayer.push({event:\"eventTracking\",trackingEventCategory:data.category,trackingEventAction:data.action,trackingEventLabel:data.label||\"\",trackingEventValue:data.value||\"\",nonInteraction:data.nonInteraction||false,eventCallback:cb});}};\nexport const __FramerMetadata__ = {\"exports\":{\"goToMarket\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EventCategory\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./goToMarket.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,forwardRef,useRef,useState,useCallback,startTransition}from\"react\";import{goToMarket}from\"https://framerusercontent.com/modules/MnjZUP24m4UFEVAo4MPz/F8apgu93f354JdSN1vAk/goToMarket.js\";import{log}from\"https://framerusercontent.com/modules/kSMCNeBYpO4VGJ0nrZPP/hw3SGPll9XzW7k0KD4Qq/log.js\";function createStore(initialState){let state=initialState;const listeners=new Set;return function useStore(){const[localState,setLocalState]=useState(state);useEffect(()=>{listeners.add(setLocalState);return()=>{listeners.delete(setLocalState);};},[]);const setStore=useCallback(patch=>{state={...state,...patch};listeners.forEach(listener=>{startTransition(()=>listener(state));});},[]);return[localState,setStore];};}export function OpenType(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function OpenTypeOverride(props,ref){return /*#__PURE__*/_jsx(WrappedComponent,{...props,ref:ref,style:{...props.style,fontFeatureSettings:`\"salt\", \"kern\", \"cv05\", \"cv11\", \"ccmp\"`}});});}// Auth Buttons\nconst useStore=createStore({userHasInitialized:false,user:null});function isUser(data){return data?.name!==undefined;}export function withUser(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithUserOverride(props,ref){const[{user},setStore]=useStore();useEffect(()=>{const fetchUser=async()=>{log(\"Fetching user\");const data=await fetch(\"https://api.framer.com/site/users/me\",{credentials:\"include\"});const user=await data.json();if(isUser(user)){goToMarket.trackEvent({category:\"HasFramerUser\",action:\"true\"});startTransition(()=>setStore({user,userHasInitialized:true}));}else{goToMarket.trackEvent({category:\"HasFramerUser\",action:\"false\"});startTransition(()=>setStore({userHasInitialized:true}));}};if(typeof window===\"undefined\"||![\"www.framer.com\",\"framer.com\"].includes(window.location.hostname)){console.log(\"Skipping the login state because we're not on framer.com\");return;}fetchUser().catch(console.error);},[]);let authenticatedProps={};if(isUser(user)){authenticatedProps={label:\"Open Framer\",avatarImage:user.avatar,avatar:!!user.avatar,avatarUrl:user.avatar,initials:user.initials,initialsValue:user.initials,initialsExplicit:Boolean(user.initials&&user.initials.trim()),initialsFromFetch:true,initialsSource:\"fetch\",link:\"https://framer.com/projects\",variant:!!user.avatar?\"Nav\":props.variant};}const componentProps={...props,...authenticatedProps};return /*#__PURE__*/_jsx(WrappedComponent,{...props,...componentProps,ref:ref});});}const useOutsideClick=callback=>{const ref=useRef(null);const[{isOpen}]=useBrandMenuStore();useEffect(()=>{const handleClick=event=>{const target=event.target;if(ref.current&&target&&!ref.current.contains(target)){callback();}};document.addEventListener(\"click\",handleClick,true);return()=>{document.removeEventListener(\"click\",handleClick,true);};},[ref,isOpen]);return ref;};export function hideWhenAuthenticated(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function HideWhenAuthenticatedOverride(props,ref){const[{user,userHasInitialized}]=useStore();const isAuthenticated=userHasInitialized&&isUser(user);return!isAuthenticated&&/*#__PURE__*/_jsx(WrappedComponent,{...props,ref:ref});});}const useBrandMenuStore=createStore({isOpen:false});export function withRightClickTrigger(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithRightClickTriggerOverride(props,ref){const[{isOpen},setStore]=useBrandMenuStore();const handleClick=e=>{e.preventDefault();if(e.type===\"contextmenu\"){startTransition(()=>setStore({isOpen:!isOpen}));}};return /*#__PURE__*/_jsx(WrappedComponent,{...props,ref:ref,onClick:handleClick,onContextMenu:handleClick});});}export function withBrandMenuOpenState(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithBrandMenuOpenStateOverride(props,ref){const[{isOpen},setStore]=useBrandMenuStore();const initialized=false;useEffect(()=>{if(!initialized){startTransition(()=>setStore({isOpen:false}));}},[]);const handleClickOutside=()=>{if(isOpen){startTransition(()=>setStore({isOpen:false}));}};const wrapperRef=useOutsideClick(handleClickOutside);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:40,left:0,pointerEvents:isOpen?\"all\":\"none\",zIndex:0},ref:wrapperRef,children:/*#__PURE__*/_jsx(WrappedComponent,{...props,ref:ref,style:{...props.style,opacity:isOpen?1:0,transform:isOpen?\"scale(1)\":\"scale(1)\",transition:\"ease 0s\",position:\"relative\"}})});});}export function withCloseOnClick(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithCloseOnClickOverride(props,ref){const[{isOpen},setStore]=useBrandMenuStore();const handleClick=_e=>{startTransition(()=>setStore({isOpen:false}));};return /*#__PURE__*/_jsx(WrappedComponent,{...props,onClick:handleClick,ref:ref});});}export function withCloseBrandMenuOnHover(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithCloseBrandMenuOnHoverOverride(props,ref){const[{isOpen},setStore]=useBrandMenuStore();const handleMouseEnter=_e=>{startTransition(()=>setStore({isOpen:false}));};return /*#__PURE__*/_jsx(WrappedComponent,{...props,onHoverStart:handleMouseEnter,ref:ref});});}export function withCopyLogo(Component){const WrappedComponent=Component;return /*#__PURE__*/forwardRef(function WithCopyLogoOverride(props,ref){const[{isOpen},setStore]=useBrandMenuStore();const handleClick=_e=>{startTransition(()=>setStore({isOpen:false}));if(typeof navigator!==\"undefined\"&&navigator.clipboard){void navigator.clipboard.writeText('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"140\" height=\"140\"><path d=\"M 44.65 33.992 L 95.35 33.992 L 95.35 59.341 L 70 59.341 Z M 44.65 59.341 L 70 59.341 L 95.35 84.691 L 44.65 84.691 Z M 44.65 84.691 L 70 84.691 L 70 110.041 Z\" fill=\"rgb(0, 0, 0)\"></path></svg>');}};return /*#__PURE__*/_jsx(WrappedComponent,{...props,onClick:handleClick,ref:ref});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRightClickTrigger\":{\"type\":\"reactHoc\",\"name\":\"withRightClickTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"OpenType\":{\"type\":\"reactHoc\",\"name\":\"OpenType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseOnClick\":{\"type\":\"reactHoc\",\"name\":\"withCloseOnClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseBrandMenuOnHover\":{\"type\":\"reactHoc\",\"name\":\"withCloseBrandMenuOnHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"hideWhenAuthenticated\":{\"type\":\"reactHoc\",\"name\":\"hideWhenAuthenticated\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCopyLogo\":{\"type\":\"reactHoc\",\"name\":\"withCopyLogo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUser\":{\"type\":\"reactHoc\",\"name\":\"withUser\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBrandMenuOpenState\":{\"type\":\"reactHoc\",\"name\":\"withBrandMenuOpenState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__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