{"version":3,"file":"feedback.js","sources":["../../src/feedback.ts"],"sourcesContent":["import type { EventHint, FeedbackEvent, SendFeedbackParams } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { getClient, getCurrentScope } from './currentScopes';\n\n/**\n * Send user feedback to Sentry.\n */\nexport function captureFeedback(\n params: SendFeedbackParams,\n hint: EventHint & { includeReplay?: boolean } = {},\n scope = getCurrentScope(),\n): string {\n const { message, name, email, url, source, associatedEventId, tags } = params;\n\n const feedbackEvent: FeedbackEvent = {\n contexts: {\n feedback: dropUndefinedKeys({\n contact_email: email,\n name,\n message,\n url,\n source,\n associated_event_id: associatedEventId,\n }),\n },\n type: 'feedback',\n level: 'info',\n tags,\n };\n\n const client = (scope && scope.getClient()) || getClient();\n\n if (client) {\n client.emit('beforeSendFeedback', feedbackEvent, hint);\n }\n\n const eventId = scope.captureEvent(feedbackEvent, hint);\n\n return eventId;\n}\n"],"names":["getCurrentScope","dropUndefinedKeys","getClient"],"mappings":";;;;;AAIA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,MAAM;AACR,EAAE,IAAI,GAA4C,EAAE;AACpD,EAAE,KAAM,GAAEA,6BAAe,EAAE;AAC3B,EAAU;AACV,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAK,EAAA,GAAI,MAAM;;AAE/E,EAAE,MAAM,aAAa,GAAkB;AACvC,IAAI,QAAQ,EAAE;AACd,MAAM,QAAQ,EAAEC,uBAAiB,CAAC;AAClC,QAAQ,aAAa,EAAE,KAAK;AAC5B,QAAQ,IAAI;AACZ,QAAQ,OAAO;AACf,QAAQ,GAAG;AACX,QAAQ,MAAM;AACd,QAAQ,mBAAmB,EAAE,iBAAiB;AAC9C,OAAO,CAAC;AACR,KAAK;AACL,IAAI,IAAI,EAAE,UAAU;AACpB,IAAI,KAAK,EAAE,MAAM;AACjB,IAAI,IAAI;AACR,GAAG;;AAEH,EAAE,MAAM,MAAA,GAAS,CAAC,SAAS,KAAK,CAAC,SAAS,EAAE,KAAKC,uBAAS,EAAE;;AAE5D,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,aAAa,EAAE,IAAI,CAAC;AAC1D;;AAEA,EAAE,MAAM,OAAQ,GAAE,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,IAAI,CAAC;;AAEzD,EAAE,OAAO,OAAO;AAChB;;;;"}