'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('prop-types'),
    c = require('./1bd76a31ed2906f15b7194ed308c79ea.js'),
    d = require('./ecfd0b8a820cd6eaae9f0adff54e7929.js'),
    e = require('./6620a0cf7dad1b400d60f0fdae40f524.js'),
    f = require('./7eeb2c181560ccef7356d4b84f50a955.js'),
    g = require('./8a6bfff9d7b1c7d81421b0982e3dda9e.js'),
    h = require('./eadce02c750c875a10680bcfedadec88.js'),
    i = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    j = require('./c4190a2430506f3602ca550e1e75d620.js'),
    k = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    l = require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),
    m = require('./5451dfc4d939398d913dc724d952b02b.js'),
    n = require('./8e764a20d4ff4876a256ceb36e40c37e.js'),
    o = require('./034f7e1a1500d5bdfa70fa5d36d9ef07.js'),
    p = require('./106eac0139723db6a35b934f19cb4aa5.js'),
    { connect: q } = require('react-redux')
  class r extends a.Component {
    componentDidMount() {
      if (this.props.win || global.isDevWindow) {
        const a = this.props.win || global.Win
        global.windowMap.set('WEB_DEBUGGER', a),
          a.setMinimumSize(1e3, 830),
          m.init(a)
      }
    }
    getChildContext() {
      return { currentNWWindow: this.props.win ? this.props.win : global.Win }
    }
    onContainerClick(a) {
      a.stopPropagation(),
        this.props.setClickkey(h.NONE),
        this.props.debuggerActions.setUrlComplete({ show: !1 })
    }
    getOptionsComponents() {
      let b = this.props,
        c = []
      return (
        b.addDeviceShow && c.push(a.createElement(p, { key: 'adddevice' })), c
      )
    }
    reloadURL() {
      let a = this.props.url
      ;(a = a.trim()),
        'about:blank' === a
          ? this.props.debuggerActions.setActions('reload')
          : (this.props.debuggerActions.setAutoComplete(a),
            this.props.debuggerActions.getA8Key({
              url: a,
              isSync: !0,
              from: 'urlbar'
            })),
        this.props.debuggerActions.setUrlComplete({ show: !1 })
    }
    onDevtoolsWindowReady() {
      this.reloadURL()
    }
    onDevtoolsWindowClose() {
      this.props.windowActions.setDebuggerWindow({ popup: !1 }),
        this.reloadURL()
    }
    onSimulatorWindowReady() {
      'popup' === this.props.simulatorPosition && this.reloadURL()
    }
    onSimulatorWindowClose() {
      this.props.windowActions.setSimulatorPosition('left'), this.reloadURL()
    }
    getSimulator() {
      let b = this.props
      if ('popup' === this.props.simulatorPosition) {
        const d = {
          className: 'standalone',
          onClick: this.onContainerClick.bind(this)
        }
        return a.createElement(e, {
          templateHTML: 'html/standalone.html',
          wrapperProps: d,
          title: '\u516C\u4F17\u53F7\u6A21\u62DF\u5668',
          frame: !0,
          show: !1,
          width: b.deviceWidth,
          height: b.deviceHeight + 27,
          resizable: !1,
          fullscreen: !1,
          always_on_top: !1,
          onWindowClose: this.onSimulatorWindowClose.bind(this),
          onReady: this.onSimulatorWindowReady.bind(this),
          renderClass: c
        })
      }
      return a.createElement(c, null)
    }
    getDevtools() {
      if (this.props.debuggerPopup) {
        this.props
        return a.createElement(e, {
          title: '\u516C\u4F17\u53F7\u8C03\u8BD5\u5668',
          frame: !0,
          show: !1,
          resizable: !0,
          fullscreen: !1,
          always_on_top: !1,
          onWindowClose: this.onDevtoolsWindowClose.bind(this),
          onReady: this.onDevtoolsWindowReady.bind(this),
          renderClass: d
        })
      }
      return a.createElement(d, null)
    }
    render() {
      return a.createElement(
        'div',
        {
          style: { height: 'inherit' },
          onClick: this.onContainerClick.bind(this)
        },
        a.createElement(
          'div',
          { className: 'header' },
          a.createElement(g, null),
          a.createElement(f, null)
        ),
        a.createElement(
          'div',
          { className: 'main' },
          this.getOptionsComponents(),
          a.createElement(o, null),
          this.getSimulator(),
          a.createElement(
            'div',
            { className: 'workbench' },
            this.getDevtools()
          ),
          this.props.noticecenterShow ? a.createElement(n, null) : null
        )
      )
    }
  }
  ;(r.childContextTypes = { currentNWWindow: b.object }),
    (module.exports = q(
      a => {
        let b = a.toolbar.clickKey,
          c = a.window.simulator || {},
          d = a.window.debug || {},
          e = a.toolbar.deviceInfo || {},
          f = a.webdebugger || {},
          g = f.url || ''
        return (
          (g &&
            g != 'html/about.html' &&
            0 != g.indexOf('chrome-extension:')) ||
            (g = 'about:blank'),
          {
            url: g,
            simulatorPosition: c.position,
            debuggerPopup: d.popup,
            addDeviceShow: a.info.addDeviceInfo && a.info.addDeviceInfo.show,
            deviceWidth: e.screenWidth,
            deviceHeight: e.screenHeight,
            noticecenterShow: h.NOTICECENTER == b || h.LOGINQRCODE == b
          }
        )
      },
      a => {
        return {
          setClickkey: i.bindActionCreators(j.setClickkey, a),
          debuggerActions: i.bindActionCreators(j, a),
          windowActions: i.bindActionCreators(k, a)
        }
      }
    )(r))
})(require('lazyload'), require)
