Files
klz-cables.com/.pnpm-store/v10/files/b7/1e077dd8bbeda8c13f80c8c07707ab56efff4fa99b5716399b1b1210e847d429f73cbe7c8e3cf88e333a7632043d6cd9cae903e4f1ba5ec17720c0a1982999
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

69 lines
1.9 KiB
Plaintext

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('./debug-build.js');
const helpers = require('./helpers.js');
/**
* Present the user with a report dialog.
*
* @param options Everything is optional, we try to fetch all info need from the current scope.
*/
function showReportDialog(options = {}) {
const optionalDocument = helpers.WINDOW.document ;
const injectionPoint = optionalDocument?.head || optionalDocument?.body;
// doesn't work without a document (React Native)
if (!injectionPoint) {
debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] Global document not defined');
return;
}
const scope = core.getCurrentScope();
const client = core.getClient();
const dsn = client?.getDsn();
if (!dsn) {
debugBuild.DEBUG_BUILD && core.debug.error('[showReportDialog] DSN not configured');
return;
}
const mergedOptions = {
...options,
user: {
...scope.getUser(),
...options.user,
},
eventId: options.eventId || core.lastEventId(),
};
const script = helpers.WINDOW.document.createElement('script');
script.async = true;
script.crossOrigin = 'anonymous';
script.src = core.getReportDialogEndpoint(dsn, mergedOptions);
const { onLoad, onClose } = mergedOptions;
if (onLoad) {
script.onload = onLoad;
}
if (onClose) {
const reportDialogClosedMessageHandler = (event) => {
if (event.data === '__sentry_reportdialog_closed__') {
try {
onClose();
} finally {
helpers.WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);
}
}
};
helpers.WINDOW.addEventListener('message', reportDialogClosedMessageHandler);
}
injectionPoint.appendChild(script);
}
exports.showReportDialog = showReportDialog;
//# sourceMappingURL=report-dialog.js.map