{"version":3,"file":"UsePageVisibility.0oKXKmbF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/V9ryrjN5Am9WM1dJeyyJ/9mrJHeWj7rhvLTLu7Yzt/UsePageVisibility.js"],"sourcesContent":["import{useState,useEffect}from\"react\";export const isBrowser=()=>typeof document===\"object\";export function getBrowserVisibilityProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){// Opera 12.10 and Firefox 18 and later support\nreturn\"visibilitychange\";}else if(typeof document.msHidden!==\"undefined\"){return\"msvisibilitychange\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitvisibilitychange\";}}export function getBrowserDocumentHiddenProp(){if(!isBrowser())return;if(typeof document.hidden!==\"undefined\"){return\"hidden\";}else if(typeof document.msHidden!==\"undefined\"){return\"msHidden\";}else if(typeof document.webkitHidden!==\"undefined\"){return\"webkitHidden\";}}export function getIsDocumentHidden(){if(!isBrowser())return;return!document[getBrowserDocumentHiddenProp()];}export function usePageVisibility(){if(!isBrowser())return;const[isVisible,setIsVisible]=useState(getIsDocumentHidden());const onVisibilityChange=()=>setIsVisible(getIsDocumentHidden());useEffect(()=>{const visibilityChange=getBrowserVisibilityProp();document.addEventListener(visibilityChange,onVisibilityChange,false);return()=>{document.removeEventListener(visibilityChange,onVisibilityChange);};});return isVisible;}\nexport const __FramerMetadata__ = {\"exports\":{\"getBrowserVisibilityProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getIsDocumentHidden\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"usePageVisibility\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isBrowser\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBrowserDocumentHiddenProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UsePageVisibility.map"],"mappings":"sIAA4F,SAAgB,GAA0B,CAAK,OAAmB,IAAU,SAAS,SAAS,OAC1L,MAAM,sBAAmC,SAAS,WAAW,OAAa,MAAM,wBAAqC,SAAS,eAAe,OAAa,MAAM,wBAAA,CAA2B,UAAgB,GAA8B,CAAK,OAAmB,IAAU,SAAS,SAAS,OAAa,MAAM,YAAyB,SAAS,WAAW,OAAa,MAAM,cAA2B,SAAS,eAAe,OAAa,MAAM,cAAA,CAAiB,UAAgB,GAAqB,CAAK,OAAmB,MAAM,CAAC,SAAS,IAAiC,UAAgB,GAAmB,CAAC,GAAG,CAAC,IAAY,OAAO,GAAK,CAAC,EAAU,EAAa,CAACA,EAAS,KAA6B,MAAuB,EAAa,KAA+O,OAAxN,MAAc,CAAC,IAAM,EAAiB,IAAgG,OAArE,SAAS,iBAAiB,EAAiB,EAAmB,QAAiB,CAAC,SAAS,oBAAoB,EAAiB,EAAqB,CAAE,GAAS,CAAW,qBADt6B,MAAc,OAAO,UAAW"}