import { UserActivity } from '../types' ; type Analytics = { track : ( eventName : string , data : Record < string , any > ) => void ; page : ( url : string ) => void ; } ; declare let global ; declare let window ; export const trackEvent = ( eventName , data ) : void => { if ( global ?. analytics ) { global . analytics . track ( eventName , data ) ; } } ; export const trackTutorialStepViewed = ( chainId , stepTitle , action ) => { trackEvent ( UserActivity . TUTORIAL_STEP_VIEWED , { protocol : chainId , stepTitle , action , } ) ; } ; export const trackStorageCleared = ( chainId ) => { trackEvent ( UserActivity . STORAGE_CLEARED , { protocol : chainId , } ) ; } ; export const trackPageView = ( url ) : void => { if ( typeof window !== 'undefined' && window . analytics ) { window . analytics . page ( url ) ; } } ;