{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/V9ryrjN5Am9WM1dJeyyJ/9mrJHeWj7rhvLTLu7Yzt/UsePageVisibility.js"],
  "sourcesContent": ["import { useState, useEffect } from \"react\";\nexport const isBrowser = () => typeof document === \"object\";\nexport function getBrowserVisibilityProp() {\n  if (!isBrowser()) return;\n  if (typeof document.hidden !== \"undefined\") {\n    // Opera 12.10 and Firefox 18 and later support\n    return \"visibilitychange\";\n  } else if (typeof document.msHidden !== \"undefined\") {\n    return \"msvisibilitychange\";\n  } else if (typeof document.webkitHidden !== \"undefined\") {\n    return \"webkitvisibilitychange\";\n  }\n}\nexport function getBrowserDocumentHiddenProp() {\n  if (!isBrowser()) return;\n  if (typeof document.hidden !== \"undefined\") {\n    return \"hidden\";\n  } else if (typeof document.msHidden !== \"undefined\") {\n    return \"msHidden\";\n  } else if (typeof document.webkitHidden !== \"undefined\") {\n    return \"webkitHidden\";\n  }\n}\nexport function getIsDocumentHidden() {\n  if (!isBrowser()) return;\n  return !document[getBrowserDocumentHiddenProp()];\n}\nexport function usePageVisibility() {\n  if (!isBrowser()) return;\n  const [isVisible, setIsVisible] = useState(getIsDocumentHidden());\n  const onVisibilityChange = () => setIsVisible(getIsDocumentHidden());\n  useEffect(() => {\n    const visibilityChange = getBrowserVisibilityProp();\n    document.addEventListener(visibilityChange, onVisibilityChange, false);\n    return () => {\n      document.removeEventListener(visibilityChange, onVisibilityChange);\n    };\n  });\n  return isVisible;\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"getBrowserVisibilityProp\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"getIsDocumentHidden\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"usePageVisibility\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"isBrowser\": {\n      \"type\": \"variable\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"getBrowserDocumentHiddenProp\": {\n      \"type\": \"function\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./UsePageVisibility.map"],
  "mappings": "gDACO,IAAMA,EAAY,IAAM,OAAO,UAAa,SAC5C,SAASC,GAA2B,CACzC,GAAKD,EAAU,EACf,IAAI,OAAO,SAAS,OAAW,IAE7B,MAAO,mBACF,GAAI,OAAO,SAAS,SAAa,IACtC,MAAO,qBACF,GAAI,OAAO,SAAS,aAAiB,IAC1C,MAAO,yBAEX,CACO,SAASE,GAA+B,CAC7C,GAAKF,EAAU,EACf,IAAI,OAAO,SAAS,OAAW,IAC7B,MAAO,SACF,GAAI,OAAO,SAAS,SAAa,IACtC,MAAO,WACF,GAAI,OAAO,SAAS,aAAiB,IAC1C,MAAO,eAEX,CACO,SAASG,GAAsB,CACpC,GAAKH,EAAU,EACf,MAAO,CAAC,SAASE,EAA6B,CAAC,CACjD,CACO,SAASE,GAAoB,CAClC,GAAI,CAACJ,EAAU,EAAG,OAClB,GAAM,CAACK,EAAWC,CAAY,EAAIC,EAASJ,EAAoB,CAAC,EAC1DK,EAAqB,IAAMF,EAAaH,EAAoB,CAAC,EACnE,OAAAM,EAAU,IAAM,CACd,IAAMC,EAAmBT,EAAyB,EAClD,gBAAS,iBAAiBS,EAAkBF,EAAoB,EAAK,EAC9D,IAAM,CACX,SAAS,oBAAoBE,EAAkBF,CAAkB,CACnE,CACF,CAAC,EACMH,CACT",
  "names": ["isBrowser", "getBrowserVisibilityProp", "getBrowserDocumentHiddenProp", "getIsDocumentHidden", "usePageVisibility", "isVisible", "setIsVisible", "ye", "onVisibilityChange", "ue", "visibilityChange"]
}
