{
  "version": 3,
  "sources": ["../../src/web/lib/setSentryContext.ts"],
  "sourcesContent": ["import type { WindowWithCurrentUser } from \"@framerjs/app-shared\"\nimport * as Sentry from \"@sentry/browser\"\nimport { getFramerRelease } from \"environment/getFramerRelease.ts\"\nimport { initialData } from \"./dataLoadingHelpers.ts\"\n\nexport async function setSentryContext() {\n\tconst user = (window as WindowWithCurrentUser).framerUser\n\n\tif (user) {\n\t\tconst project = await initialData.project.catch(() => undefined)\n\t\tconst { id, email } = user\n\t\tconst teamId = project?.space.id || user.defaultSpaceId\n\t\tconst domain = email.substring(email.indexOf(\"@\") + 1)\n\t\tSentry.setUser({ id })\n\t\tSentry.setContext(\"team\", {\n\t\t\tid: teamId,\n\t\t\tdomain,\n\t\t})\n\t}\n\n\tconst release = getFramerRelease(window)\n\tif (release) {\n\t\tlet { channel, override } = release\n\t\t// This generally should not happen, because we don\u2019t trigger Sentry\n\t\t// events from PR previews or the tunnel. Adding here for completeness.\n\t\tif (override) {\n\t\t\tchannel += `+${override}`\n\t\t}\n\t\tSentry.setTag(\"channel\", channel)\n\t}\n}\n"],
  "mappings": ";;;;;;;;;;;;;AAKA,eAAsB,mBAAmB;AACxC,QAAM,OAAQ,OAAiC;AAE/C,MAAI,MAAM;AACT,UAAM,UAAU,MAAM,YAAY,QAAQ,MAAM,MAAM,MAAS;AAC/D,UAAM,EAAE,IAAI,MAAM,IAAI;AACtB,UAAM,SAAS,SAAS,MAAM,MAAM,KAAK;AACzC,UAAM,SAAS,MAAM,UAAU,MAAM,QAAQ,GAAG,IAAI,CAAC;AACrD,IAAO,QAAQ,EAAE,GAAG,CAAC;AACrB,IAAO,WAAW,QAAQ;AAAA,MACzB,IAAI;AAAA,MACJ;AAAA,IACD,CAAC;AAAA,EACF;AAEA,QAAM,UAAU,iBAAiB,MAAM;AACvC,MAAI,SAAS;AACZ,QAAI,EAAE,SAAS,SAAS,IAAI;AAG5B,QAAI,UAAU;AACb,iBAAW,IAAI,QAAQ;AAAA,IACxB;AACA,IAAO,OAAO,WAAW,OAAO;AAAA,EACjC;AACD;",
  "names": []
}
