content: import 'babel-polyfill'
  import 'whatwg-fetch'
  import React from 'react'
  import ReactDOM from 'react-dom'
  import { createStore, applyMiddleware } from 'redux'
  import { Provider } from 'react-redux'
  import createSagaMiddleware from 'redux-saga'
  import injectTapEventPlugin from 'react-tap-event-plugin'
  
  import App from '/containers/App'
  import reducer from '/reducers'
  import saga from '/sagas'
  import userAgent from '/styles/userAgent'
  import { urlParams, inspectMode } from '/utils'
  import { bizStatus } from '/constants'
  import { initLocalFolders } from '/utils/file'
  import {
    generateItem,
    inspectDealRequest
  } from '/actions'
  
  PJF.html.bodyReady(() => {
    // Needed for onTouchTap
    injectTapEventPlugin()
  
    const sagaMiddleware = createSagaMiddleware()
    const store = createStore(reducer, applyMiddleware(sagaMiddleware))
    sagaMiddleware.run(saga)
  
    if (urlParams.Txn_Prim_ID && inspectMode) {
      store.dispatch(inspectDealRequest({
        dealNo: urlParams.Txn_Prim_ID
      }))
    } else if (urlParams.PROCESS_INST_ID) {
      const packageNamePrefix = urlParams.Txn_Prim_ID
        ? urlParams.Txn_Prim_ID
        : urlParams.PROCESS_INST_ID
      store.dispatch(generateItem({
        name: packageNamePrefix,
        itemNo: urlParams.PROCESS_INST_ID,
        dealNo: urlParams.Txn_Prim_ID,
        itemProfile: urlParams.Item_Profile,
        stepId: urlParams.ItnSt_Mnplt_Step_Cd,
        primId: urlParams.Prim_AR_ID
      }))
    }
  
    ReactDOM.render(
      <Provider store={store}>
        <App radiumConfig={{
            userAgent
          }} />
      </Provider>,
      document.getElementById('root')
    )
  
    initLocalFolders()
  })
  