{"version":3,"file":"globalListeners.js","sources":["../../../../../src/metrics/web-vitals/lib/globalListeners.ts"],"sourcesContent":["import { WINDOW } from '../../../types';\n\n/**\n * web-vitals 5.1.0 switched listeners to be added on the window rather than the document.\n * Instead of having to check for window/document every time we add a listener, we can use this function.\n */\nexport function addPageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions) {\n if (WINDOW.document) {\n WINDOW.addEventListener(type, listener, options);\n }\n}\n/**\n * web-vitals 5.1.0 switched listeners to be removed from the window rather than the document.\n * Instead of having to check for window/document every time we remove a listener, we can use this function.\n */\nexport function removePageListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions) {\n if (WINDOW.document) {\n WINDOW.removeEventListener(type, listener, options);\n }\n}\n"],"names":["WINDOW"],"mappings":";;;;AAEA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAU,QAAQ,EAAiB,OAAO,EAAsC;AACpH,EAAE,IAAIA,YAAM,CAAC,QAAQ,EAAE;AACvB,IAAIA,YAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;AACpD,EAAE;AACF;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAU,QAAQ,EAAiB,OAAO,EAAsC;AACvH,EAAE,IAAIA,YAAM,CAAC,QAAQ,EAAE;AACvB,IAAIA,YAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;AACvD,EAAE;AACF;;;;;"}