// @flow weak

let raven
let DSN
let config

if (process.env.PLATFORM === 'browser') {
  raven = require('raven-js')
  DSN = 'https://f1690f74cc6e432e922f32da3eb051c9@sentry.io/133417'
  config = {
    release: window.clientData.releaseVersion,
  }
} else {
  raven = require('raven')
  DSN = 'https://261cb80891cb480fa452f7e18c0e57c0:dc050bb97a4d4692aa3e957c5c89d393@sentry.io/133418'
  config = {
    autoBreadcrumbs: true,
    release: require('../../config').default.get('heroku.releaseVersion'),
  }
}

const crashReporter = {
  init: () => {
    raven.config(DSN, {
      environment: process.env.NODE_ENV, // Should always be production
      ...config,
    })

    if (process.env.NODE_ENV === 'production') {
      raven.install()
    }
  },
  captureException: (...args) => raven.captureException(...args),
  requestHandler: () => raven.requestHandler(),
  errorHandler: () => raven.errorHandler(),
}

export default crashReporter

@@ -30,17 +30,22 @@
 DSN%0Alet 
-c
+ravenC
 onfig%0A%0Ai
@@ -115,16 +115,65 @@
 en-js')%0A
+  if (process.env.NODE_ENV === 'production') %7B%0A  
   DSN = 
@@ -230,25 +230,61 @@
 o/133417'%0A  
-c
+%7D else %7B%0A    DSN = false%0A  %7D%0A  ravenC
 onfig = %7B%0A  
@@ -368,16 +368,65 @@
 raven')%0A
+  if (process.env.NODE_ENV === 'production') %7B%0A  
   DSN = 
@@ -520,17 +520,53 @@
 3418'%0A  
-c
+%7D else %7B%0A    DSN = false%0A  %7D%0A  ravenC
 onfig = 
@@ -821,17 +821,22 @@
      ...
-c
+ravenC
 onfig,%0A 
@@ -845,60 +845,8 @@
  %7D)%0A
-%0A    if (process.env.NODE_ENV === 'production') %7B%0A  
     
@@ -865,14 +865,8 @@
 l()%0A
-    %7D%0A
   %7D,

disable in dev mode