mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
1 line
7.0 KiB
JSON
1 line
7.0 KiB
JSON
{"ast":null,"code":"import { supportsReportingObserver, getGlobalObject } from '@sentry/utils';\n\n/** Reporting API integration - https://w3c.github.io/reporting/ */\nclass ReportingObserver {\n /**\n * @inheritDoc\n */\n static __initStatic() {\n this.id = 'ReportingObserver';\n }\n\n /**\n * @inheritDoc\n */\n __init() {\n this.name = ReportingObserver.id;\n }\n\n /**\n * Returns current hub.\n */\n\n /**\n * @inheritDoc\n */\n constructor(_options = {\n types: ['crash', 'deprecation', 'intervention']\n }) {\n ;\n this._options = _options;\n ReportingObserver.prototype.__init.call(this);\n }\n\n /**\n * @inheritDoc\n */\n setupOnce(_, getCurrentHub) {\n if (!supportsReportingObserver()) {\n return;\n }\n this._getCurrentHub = getCurrentHub;\n var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), {\n buffered: true,\n types: this._options.types\n });\n observer.observe();\n }\n\n /**\n * @inheritDoc\n */\n handler(reports) {\n var hub = this._getCurrentHub && this._getCurrentHub();\n if (!hub || !hub.getIntegration(ReportingObserver)) {\n return;\n }\n for (var report of reports) {\n hub.withScope(scope => {\n scope.setExtra('url', report.url);\n var label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inheirted\n var plainBody = {};\n for (var prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n scope.setExtra('body', plainBody);\n if (report.type === 'crash') {\n var body = report.body;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n var body = report.body;\n details = body.message || details;\n }\n }\n hub.captureMessage(`${label}: ${details}`);\n });\n }\n }\n}\nReportingObserver.__initStatic();\nexport { ReportingObserver };","map":{"version":3,"names":["supportsReportingObserver","getGlobalObject","ReportingObserver","__initStatic","id","__init","name","constructor","_options","types","prototype","call","setupOnce","_","getCurrentHub","_getCurrentHub","observer","handler","bind","buffered","observe","reports","hub","getIntegration","report","withScope","scope","setExtra","url","label","type","details","body","plainBody","prop","crashId","reason","join","trim","message","captureMessage"],"sources":["C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@sentry/integrations/esm/reportingobserver.js"],"sourcesContent":["import { supportsReportingObserver, getGlobalObject } from '@sentry/utils';\n\n/** Reporting API integration - https://w3c.github.io/reporting/ */\nclass ReportingObserver {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'ReportingObserver';}\n\n /**\n * @inheritDoc\n */\n __init() {this.name = ReportingObserver.id;}\n\n /**\n * Returns current hub.\n */\n \n\n /**\n * @inheritDoc\n */\n constructor(\n _options\n\n = {\n types: ['crash', 'deprecation', 'intervention'],\n },\n ) {;this._options = _options;ReportingObserver.prototype.__init.call(this);}\n\n /**\n * @inheritDoc\n */\n setupOnce(_, getCurrentHub) {\n if (!supportsReportingObserver()) {\n return;\n }\n\n this._getCurrentHub = getCurrentHub;\n\n var observer = new (getGlobalObject().ReportingObserver)(this.handler.bind(this), {\n buffered: true,\n types: this._options.types,\n });\n\n observer.observe();\n }\n\n /**\n * @inheritDoc\n */\n handler(reports) {\n var hub = this._getCurrentHub && this._getCurrentHub();\n if (!hub || !hub.getIntegration(ReportingObserver)) {\n return;\n }\n for (var report of reports) {\n hub.withScope(scope => {\n scope.setExtra('url', report.url);\n\n var label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inheirted\n var plainBody\n\n = {};\n\n for (var prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n\n scope.setExtra('body', plainBody);\n\n if (report.type === 'crash') {\n var body = report.body ;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n var body = report.body ;\n details = body.message || details;\n }\n }\n\n hub.captureMessage(`${label}: ${details}`);\n });\n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