'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('prop-types'),
    c = require('./37b4e44f6cb5308df338387678f31341.js'),
    d = require('./a44d6a009a6865f76e1da47c6c84025a.js'),
    e = require('./0b33efa8324f13c48329436edfa8d2c3.js'),
    f = require('./f53c8427c995d0915bad1fb1a545b516.js'),
    g = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    h = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    i = require('./1f98c7ca32b0549d99bce70cd41a3fcd.js'),
    j = require('redux'),
    k = require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),
    { connect: l } = require('react-redux')
  class m extends a.Component {
    constructor(a) {
      super(a), (this.state = { alwaysOnTop: !1 })
    }
    toggleSimulatorPosition() {
      this.props.toggleSimulatorPosition()
    }
    toggleAlwaysOnTop() {
      let a
      try {
        ;(a = this.context.window || nw.Window.get()),
          a.setAlwaysOnTop(!this.state.alwaysOnTop),
          this.setState({ alwaysOnTop: !this.state.alwaysOnTop })
      } catch (a) {}
    }
    render() {
      return global.onlySimulator
        ? null
        : this.context.isPopup
          ? a.createElement(
              'div',
              { className: 'simulator-toolbar' },
              a.createElement(c, { id: 'simulator-toolbar-compact' }),
              this.props.mainWindow === k.MAIN_WINDOW_TYPE.WEB_DEBUGGER
                ? null
                : a.createElement(d, { id: 'simulator-toolbar-status' }),
              a.createElement(
                'div',
                { className: 'simulator-toolbar-action' },
                a.createElement(
                  'a',
                  { href: 'javascript:;' },
                  a.createElement('i', {
                    className: this.state.alwaysOnTop
                      ? 'ui-icon-thumbtack-pinned'
                      : 'ui-icon-thumbtack',
                    onClick: this.toggleAlwaysOnTop.bind(this)
                  })
                ),
                a.createElement(
                  'a',
                  { href: 'javascript:;' },
                  a.createElement('i', {
                    className: 'ui-icon-attach',
                    onClick: this.props.toggleSimulatorPopup
                  })
                )
              )
            )
          : a.createElement(
              'div',
              { className: 'simulator-toolbar' },
              a.createElement(f, { id: 'simulator-toolbar-device' }),
              a.createElement(i, { id: 'simulator-toolbar-scale' }),
              a.createElement(e, { id: 'simulator-toolbar-network' }),
              a.createElement(
                'div',
                { className: 'simulator-toolbar-action' },
                a.createElement(
                  'a',
                  { href: 'javascript:;' },
                  a.createElement('i', {
                    className: 'ui-icon-detach',
                    onClick: this.props.toggleSimulatorPopup
                  })
                )
              )
            )
    }
  }
  ;(m.contextTypes = { isPopup: b.bool, window: b.object }),
    (module.exports = l(
      a => {
        let b = a.window.simulator || {},
          c = a.window.mainWindow
        return { mainWindow: c, simulatorShow: b.show }
      },
      a => {
        return {
          toggleSimulatorPosition: () => a(g.toggleSimulatorPosition()),
          toggleSimulatorPopup: () => a(g.toggleSimulatorPopup())
        }
      }
    )(m))
})(require('lazyload'), require)
